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: "paolo.carlini at oracle dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 17 Jan 2012 18:38:35 +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
--- Comment #1 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-01-17 18:38:35 UTC ---
What happens if you add to the command line -fno-strict-aliasing? If things
'improve' it means that with your reinterpret_cast & co you have aliasing
violations, thus undefined behavior, thus, literally, anything can happen, and
this is not a bug (and we have hundreds of closed duplicate PRs in Bugzilla)