MIN/MAX should be treated similar as comparisons for trapping
commit5fecfed8788eb114508e36e465147f2bb856fa33
authorAndrew Pinski <apinski@marvell.com>
Sat, 1 Apr 2023 22:50:27 +0000 (1 22:50 +0000)
committerAndrew Pinski <apinski@marvell.com>
Thu, 27 Apr 2023 15:00:25 +0000 (27 08:00 -0700)
tree49a4aa2dba82270f060fc6231c51dce8d84b5ac8
parentba9975a259656d099b67ad2b9c69bf970be2b210
MIN/MAX should be treated similar as comparisons for trapping

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.
gcc/rtlanal.cc
gcc/tree-eh.cc