https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107608
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |rguenth at gcc dot gnu.org --- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> --- I think we are not properly preserving IEEE exceptions in DCE and friends. We happily elide void foo(float x) { x + x; } even at -O0 - the above is elided in the gimplifier. With -fnon-call-exceptions we are a bit more careful (but the above is gone in the gimplifier still). That said, as long as -ftrapping-math is default changing behavior isn't a good idea IMHO. We very likely have very many lurking issues that would leave us with dead unused code around if we just fix DCE here. As you show it's not really a regression either.