This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/60237] isnan fails with -ffast-math
- From: "glisse at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 17 Feb 2014 11:26:03 +0000
- Subject: [Bug c++/60237] isnan fails with -ffast-math
- Auto-submitted: auto-generated
- References: <bug-60237-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60237
--- Comment #3 from Marc Glisse <glisse at gcc dot gnu.org> ---
(In reply to N Schaeffer from comment #2)
> Do you have a suggestion concerning my last question:
> How can I check if x is NaN in a portable way (not presuming any compilation
> option) ?
This should bypass software optimizations. But if the hardware is put in a mode
that does strange things with NaN, it will be harder to work around.
int my_isnan(double x){
volatile double y=x;
return y!=y;
}