[Bug c++/60237] isnan fails with -ffast-math

2014-02-17 Thread glisse at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60237 --- Comment #7 from Marc Glisse --- (In reply to N Schaeffer from comment #6) > Is there somewhere a rationale for not making isnan() find NaN's with > -ffinite-math-only ? finite-math-only is basically a promise that isinf and isnan always retur

[Bug c++/60237] isnan fails with -ffast-math

2014-02-17 Thread nathanael.schaeffer at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60237 --- Comment #6 from N Schaeffer --- -fno-builtin-isnan is also interesting, thanks. Is there somewhere a rationale for not making isnan() find NaN's with -ffinite-math-only ?

[Bug c++/60237] isnan fails with -ffast-math

2014-02-17 Thread rguenth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60237 Richard Biener changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|---

[Bug c++/60237] isnan fails with -ffast-math

2014-02-17 Thread nathanael.schaeffer at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60237 --- Comment #4 from N Schaeffer --- int my_isnan(double x){ volatile double y=x; return y!=y; } is translated to: 0x00406cf0 <+0>: movsd QWORD PTR [rsp-0x8],xmm0 0x00406cf6 <+6>: xoreax,eax 0x0040

[Bug c++/60237] isnan fails with -ffast-math

2014-02-17 Thread glisse at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60237 --- Comment #3 from Marc Glisse --- (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 so

[Bug c++/60237] isnan fails with -ffast-math

2014-02-17 Thread nathanael.schaeffer at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60237 --- Comment #2 from N Schaeffer --- Thank you for your answer. My program (which is a computational fluid dynamics solver) is not supposed to produce NaNs. However, when it does (which means something went wrong), I would like to abort the progra

[Bug c++/60237] isnan fails with -ffast-math

2014-02-17 Thread jakub at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60237 Jakub Jelinek changed: What|Removed |Added CC||jakub at gcc dot gnu.org --- Comment #1 f