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 rtl-optimization/323] optimized code gives strange floating point results


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


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