This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/323] optimized code gives strange floating point results
- From: "eda-qa at disemia dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 1 Dec 2004 16:24:22 -0000
- Subject: [Bug rtl-optimization/323] optimized code gives strange floating point results
- References: <20000614141601.323.mirtich@merl.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From eda-qa at disemia dot com 2004-12-01 16:24 -------
To summarize, this defect effectively states that:
assert( (x/y) == (x/y) )
may cause an assertion if compiled with optimization.
While I understand why it happens, that doesn't mean it isn't a defect. This
makes it impossible to turn on the optimizer with any code using floating point
and still expect to get a correct result. Perhaps in some situations this is
okay, but in general this is not.
This would also mean the following are also invalid code -- which I'm fairly
certain the C/C++ standards would state otherwise:
a = (x/y);
assert( a == x/y ) //may Abort
if( a == x/y )
assert( a == x/y ) //may Abort
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=323