https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57029
--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> --- PR84407 was related which was about rounding modes and int-to-float conversion which means the testcase in this bug should now also be fixed if you supply -frounding-math which is documented as to determine the default of #pragma STDC FENV_ACCESS when the latter is implemented. But yes, -ftrapping-math is not enough to preserve the conversions from being constant folded (and thus the exception being lost). Not sure if separate control of this is really desirable.