While looking into moving optimizations from minmax_replacement
in phiopt to match.pd, I Noticed that min/max were considered
trapping even if -ffinite-math-only was being used. This changes
those expressions to be similar as comparisons so that they are
not considered trapping if -ffinite-math-only is on.
OK? Bootstrapped and tested with no regressions on x86_64-linux-gnu.
gcc/ChangeLog:
* rtlanal.cc (may_trap_p_1): Treat SMIN/SMAX similar as
COMPARISON.
* tree-eh.cc (operation_could_trap_helper_p): Treate
MIN_EXPR/MAX_EXPR similar as other comparisons.
case LT:
case LTGT:
case COMPARE:
+ /* Treat min/max similar as comparisons. */
+ case SMIN:
+ case SMAX:
/* Some floating point comparisons may trap. */
if (!flag_trapping_math)
break;
case GT_EXPR:
case GE_EXPR:
case LTGT_EXPR:
+ /* MIN/MAX similar as LT/LE/GT/GE. */
+ case MIN_EXPR:
+ case MAX_EXPR:
/* Some floating point comparisons may trap. */
return honor_nans;