public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* fast_math_flags_set_p vs. set_fast_math_flags inconsistency?
@ 2020-01-21 14:52 Ulrich Weigand
  2020-01-21 15:05 ` Joseph Myers
  0 siblings, 1 reply; 9+ messages in thread
From: Ulrich Weigand @ 2020-01-21 14:52 UTC (permalink / raw)
  To: gcc, joseph

Hello,

the -ffast-math command line option sets a bunch of other flags
internally, as implemented in set_fast_math_flags.  It is possible
to selectively override those flags on the command line as well.

I'm now wondering under what circumstances the __FAST_MATH__ macro
should still be defined.  This is currently implemented in the
fast_math_flags_set_p routine, which checks the status of *some*
(but not all!) of the flags implied by -ffast-math.

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?)

Or is this just a bug and fast_math_flags_set_p ought to check
all flags implied by -ffast-math?

Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU/Linux compilers and toolchain
  Ulrich.Weigand@de.ibm.com

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-01-29  9:52 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-21 14:52 fast_math_flags_set_p vs. set_fast_math_flags inconsistency? Ulrich Weigand
2020-01-21 15:05 ` Joseph Myers
2020-01-21 15:39   ` Ulrich Weigand
2020-01-21 18:50     ` Joseph Myers
2020-01-28 15:55       ` Ulrich Weigand
2020-01-28 17:19         ` Joseph Myers
2020-01-30  5:44           ` Ulrich Weigand
2020-01-30 10:00             ` Joseph Myers
2020-01-30 12:33               ` Ulrich Weigand

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).