This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/51885] g++ compiler options -O2 and -O3 modifies program results
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 17 Jan 2012 18:44:32 +0000
- Subject: [Bug c++/51885] g++ compiler options -O2 and -O3 modifies program results
- Auto-submitted: auto-generated
- References: <bug-51885-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51885
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-01-17 18:44:32 UTC ---
The reinterpret_cast definitely results in undefined behaviour, because it
accesses the float objects through a different type, violating [basic.lval]/10
And indeed, -fno-strict-aliasing makes the problem go away.
Someone didn't read http://gcc.gnu.org/bugs/ carefully.