This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: fast_math_flags_set_p vs. set_fast_math_flags inconsistency?
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Ulrich Weigand <uweigand at de dot ibm dot com>
- Cc: <gcc at gcc dot gnu dot org>
- Date: Mon, 27 Jan 2020 20:20:07 +0000
- Subject: Re: fast_math_flags_set_p vs. set_fast_math_flags inconsistency?
- Ironport-sdr: h+oVpym/j44JK160zcpYQV5gEnkFT4QyQnh5BW5bZABi7Xm1xOmdD90m7/30jsMzz3uJuhnNjC f43FseeqIczLzQqO6FHgLfdCJ7QlBzHHSCNjUFbClyOaB9UwsJpFpCOb7suoEKuXkqP5LPMHGN WzXEs9618hT/a+10sOeBR8ymJn7Os7hS2cpeaRVg8zX5HbrmmDpi75km33XBicjFnd25d0RFf0 zpsABuUZQeM8sVWSlc5R+VAUpak5CFINEJ2cFr/ZUnZwuV5VlJf3KjRTFOygK+LoJg/Jilwre6 0MQ=
- Ironport-sdr: Aw/rWbcdu0RwgzC09z7/HXXAYDPMPywucov1I+pDmZN1iGSPNlOO3H83FKzAnE7elIQGyGunkl Cr1qr+FZpUXQ==
- References: <20200127182612.63BE1D803D2@oc3748833570.ibm.com>
On Mon, 27 Jan 2020, Ulrich Weigand wrote:
> I see. I guess that makes me wonder what -fno-fast-math *ever* does
> (except canceling a -ffast-math earlier on the command line). Looking
> at the current code, -fno-fast-math (just like -ffast-math) only ever
> sets flags whose default is not overridden on the command line, but
> then it always sets them to their default value!
As a general principle, more specific flags take precedence over less
specific ones, regardless of the command-line order. So it's correct for
-ffast-math and -fno-fast-math not to do anything with a flag that was
explicitly overridden by the user (modulo any issues where a particular
combination of flags is unsupported by GCC, as with the
"%<-fassociative-math%> disabled; other options take precedence" case in
toplev.c).
--
Joseph S. Myers
joseph@codesourcery.com