https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55522
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |rguenth at gcc dot gnu.org --- Comment #17 from Richard Biener <rguenth at gcc dot gnu.org> --- Note that when a shared library wants -ffast-math like behavior (FTZ, etc.) _not_ linking crtfastmath.o will cause its behavior to depend on the process loading it and whether that sets the appropriate flags or not. That might also cause highly surprising effects. That said, a "true fix" would redesign how these things work and make FTZ part of the instruction encoding. I suppose setting/restoring the control word around all public API of a translation unit (and with LTO a bit more optimized) would be prohibitly expensive. Short of dropping the feature or re-implementing it, for example in the dynamic loader via some ELF annotations with documented behavior on "mismatch", I don't see any fix for this bug besides asking users to conciously not link with -ffast-math when building shared libraries - unless that's intended.