[Bug c/47297] Inconsistent float-point to integer results depending on -O flag

joseph at codesourcery dot com gcc-bugzilla@gcc.gnu.org
Fri Jan 14 17:37:00 GMT 2011


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47297

--- Comment #1 from joseph at codesourcery dot com <joseph at codesourcery dot com> 2011-01-14 17:04:30 UTC ---
On Fri, 14 Jan 2011, mateusz at loskot dot net wrote:

> In spite of the fact the behavior is undefined, I suspect the intent
> is to be consistent (which appears to be for lots of other
> values I have tried), but they are not.

No, the intent is not to be consistent.  (The intent is that each instance 
of such a conversion executed in the abstract machine results in an 
unspecified value, as per C99 Annex F, rather than more fully optimizing 
based on undefined behavior, but not for anything more consistent than 
producing unspecified values.)



More information about the Gcc-bugs mailing list