This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/47297] Inconsistent float-point to integer results depending on -O flag
- From: "joseph at codesourcery dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 14 Jan 2011 17:04:43 +0000
- Subject: [Bug c/47297] Inconsistent float-point to integer results depending on -O flag
- Auto-submitted: auto-generated
- References: <bug-47297-4@http.gcc.gnu.org/bugzilla/>
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.)