[Bug c/85661] double comparison illegally statically reduced

2018-05-05 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85661

Andrew Pinski  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |DUPLICATE

--- Comment #3 from Andrew Pinski  ---
See bug 323.

*** This bug has been marked as a duplicate of bug 323 ***

[Bug c/85661] double comparison illegally statically reduced

2018-05-05 Thread manuel.serrano at inria dot fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85661

--- Comment #2 from manuel.serrano at inria dot fr ---
Dear Jakub,

Thank you very much for your useful answer. I was indeed ignorant of the
-fexcess-precision=fast option and as you suggested "-msse2 -mfpmath=sse"
solves the problem. I'm still puzzled why inserting a dummy printf changes
the behaviour of the double equality test. Is that expected?

[Bug c/85661] double comparison illegally statically reduced

2018-05-05 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85661

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #1 from Jakub Jelinek  ---
If this is on i?86 32-bit, then most likely you just aren't taking into account
the extended precision and the default -fexcess-precision=fast mode.
So, either if you want excess precision, but require the C rules (and are using
C), you need to use -fexcess-precision=standard (default in strict C std
modes), or if you don't want excess precision, make sure you have SSE2 or later
hw and use -msse2 -mfpmath=sse.  In any case, that is a user error rather than
compiler bug.