This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/49338] wrong code with -O2 and -O3
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 9 Jun 2011 09:08:56 +0000
- Subject: [Bug c++/49338] wrong code with -O2 and -O3
- Auto-submitted: auto-generated
- References: <bug-49338-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49338
--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-06-09 09:08:51 UTC ---
Try -Wstrict-aliasing=2 or -Wstrict-aliasing=1 if -Wstrict-aliasing doesn't
report anything. Anyway, why are you fighting so hard to avoid fixing your
buggy code? It isn't hard to rewrite it using an union:
union { U64 i; double d; } u;
u.i = m_Value.m_U64 & ~((U64)1);
return u.d;