This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: fast_math_flags_set_p vs. set_fast_math_flags inconsistency?


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]