https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114131
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|normal |enhancement --- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- I am almost positive this is due to GCC default of trapping math here. Adding -fno-trapping-math GCC no longer has a check against NaN. I think test2 can cause an fp exception to happen so it is almost definitely not valid transformation unless with -fno-trapping-math. As far as transforming test1 to test3, well it depends on if there are no instructions to do the comparison and you are doing "soft" float for that type. Basically we have: ``` _1 = ABS_EXPR <x_3(D)>; _2 = _1 u<= 1.18973149535723176508575932662800701619646905264169404553e+4932; _4 = ~_2; ``` Which we could recognize in the middle-end to do the transformation if the FP format is easy to handle (double double is one which is not).