https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79128
Bug ID: 79128 Summary: export unsafe-math-optimization cpp defintion Product: gcc Version: 6.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: jtaylor.debian at googlemail dot com Target Milestone: --- GCC provides the __FAST_MATH__ when building with -ffast-math. This allows c libraries to use other types of math functions that still comply with this setting, e.g. vectorized variants. A big issue is that -ffast-math is too aggressive for many programs, in particular -ffinite-math is a big problem for many programs that could otherwise live with more relaxed math. It would be nice if GCC provides finer grained cpp definitions for libraries to use. E.g. -funsafe-math-optimizations or the subflags it enables are often acceptable for numeric applications. Having a definition available for libraries would allow for example to use glibc libmvec without pulling -ffinite-math which you usually don't won't (note until glibc 2.25 libmvec is compliant with -fno-finite-math, if gcc exports more information it would be worthwhile to revert this change, making it much more useful).