[Bug target/55522] -funsafe-math-optimizations is unexpectedly harmful, especially w/ -shared

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Dec 26 01:12:23 GMT 2022


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55522

--- Comment #31 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by hongtao Liu <liuhongt@gcc.gnu.org>:

https://gcc.gnu.org/g:e54375d85d4aa5889869c2672158083b2106b623

commit r13-4891-ge54375d85d4aa5889869c2672158083b2106b623
Author: liuhongt <hongtao.liu@intel.com>
Date:   Mon Dec 12 15:43:58 2022 +0800

    x86: Add a new option -mdaz-ftz to enable FTZ and DAZ flags in MXCSR.

    if (mdaz-ftz)
      link crtfastmath.o
    else if ((Ofast || ffast-math || funsafe-math-optimizations)
             && !shared && !mno-daz-ftz)
      link crtfastmath.o
    else
      Don't link crtfastmath.o

    gcc/ChangeLog:

            PR target/55522
            PR target/36821
            * config/i386/gnu-user-common.h (GNU_USER_TARGET_MATHFILE_SPEC):
            Link crtfastmath.o whenever -mdaz-ftz is specified. Don't link
            crtfastmath.o when -share or -mno-daz-ftz is specified.
            * config/i386/i386.opt (mdaz-ftz): New option.
            * doc/invoke.texi (x86 options): Document mftz-daz.


More information about the Gcc-bugs mailing list