https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121807
Xi Ruoyao <xry111 at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
CC| |xry111 at gcc dot gnu.org
See Also| |https://gcc.gnu.org/bugzill
| |a/show_bug.cgi?id=34678
Resolution|--- |DUPLICATE
--- Comment #3 from Xi Ruoyao <xry111 at gcc dot gnu.org> ---
The standard only mandates this exception to be raised if #pragma STDC
FENV_ACCESS ON, that GCC has not implemented yet.
In this case "!(NAN > 0.f)" is folded to simply "true" and caused the problem,
and the standard explicitly says it's allowed without FENV_ACCESS ON:
The purpose of the FENV_ACCESS pragma is to allow certain optimizations that
could subvert flag tests and mode changes (e.g., global common subexpression
elimination, code motion, and constant folding). In general, if the state of
FENV_ACCESS is "off", the translator can assume that the flags are not tested,
and that default modes are in effect, except where specified
otherwise by an FENV_ROUND pragma.
Thus this is a dup of 34678 (lacking FENV_ACCESS support), actually. And 34678
already has a lot of discussion about constant folding.
*** This bug has been marked as a duplicate of bug 34678 ***