https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84949
Bug ID: 84949
Summary: -ffast-math bugged with respect to NaNs
Product: gcc
Version: 5.4.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: [email protected]
Target Milestone: ---
When -ffast-math is specified, NaNs are broken in _one_ of the following ways:
(A)
std::isnan() and std::fpclassify() are broken in that they fail to identify
NaNs.
-OR-
(B)
std::numeric_limits<T>::has_quiet_NaN() is broken in that it claims that NaNs
are supported.
Seen with both g++ 4.8.4 on Ubuntu 14.04, as well as g++ 5.4.0 on MS Windows
Subsystem for Linux, using the following set of compiler flags in both cases:
-pipe -Wno-multichar -Wno-write-strings -fno-enforce-eh-specs
-Wno-non-template-friend -s -O3 -ffast-math -march=native -pthread