This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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;
}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]