This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/56577] wrong code for aliased union on gcc 4.7 only
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 11 Mar 2013 10:32:17 +0000
- Subject: [Bug tree-optimization/56577] wrong code for aliased union on gcc 4.7 only
- Auto-submitted: auto-generated
- References: <bug-56577-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56577
--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> 2013-03-11 10:32:17 UTC ---
(In reply to comment #2)
> You cannot use union to avoid aliasing rules for normal accesses.
Though some people may read the C standard as allowing this (even just
creating a union type of int and long makes all accesses to int and long
alias). ISTR some defect reports for this as well.
That said, GCC certainly interprets the C standard and implements it
like Jakub and Andrew said (and we won't change that). Use
-fno-strict-aliasing
if you are not happy with that.