fast_math_flags_set_p vs. set_fast_math_flags inconsistency?

Joseph Myers joseph@codesourcery.com
Tue Jan 21 15:05:00 GMT 2020


On Mon, 20 Jan 2020, Ulrich Weigand wrote:

> This has the effect that e.g. after
> 
>   -ffast-math -fno-finite-math-only
> 
> the __FAST_MATH__ macro is no longer predefined, but after
> 
>   -ffast-math -fno-associative-math
> 
> the __FAST_MATH__ macro still *is* predefined, even though both
> -ffinite-math-only and -fassociative-math are implied by -ffast-math.
> 
> Is this deliberate?  (If so, is it documented somewhere?)

I'd expect both to cause it to be undefined.  My guess would be that some 
past patch, after fast_math_flags_set_p was added, added more flags to 
-ffast-math but accidentally failed to update fast_math_flags_set_p; you'd 
need to look at past patches adding flags to -ffast-math to confirm if 
it's accidental.

-- 
Joseph S. Myers
joseph@codesourcery.com



More information about the Gcc mailing list