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

--- Comment #2 from Andreas Gustafsson <gson at gson dot org> ---
Re "simply don't use -ffast-math if you are dealing with stuff like denormals",
the documentation for -ffinite-math-only (which is implied by -ffast-math) says
"Allow optimizations for floating-point arithmetic that assume that arguments
and results are not NaNs or +-Infs".  It does not mention denormals, which to
me suggests that optimizations that assume arguments are not denormals are
*not* allowed.

Also, since we are discussing the case where DAZ is 0, it is likely that FTZ
(Flush To Zero) is also 0.  This means that even if all the inputs to the
computation compiled with -ffast-math are guaranteed not to be denormals,
denormals can arise within the computation itself, for example any time two
inputs are added, subtracted, multiplied, or divided.  In other words, if you
can't use -ffast-math "when dealing with denormals", you can't use it for any
code that does arithmetic on its inputs, which is pretty much the same thing as
saying you can't use it ever.

Reply via email to