This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/56577] wrong code for aliased union on gcc 4.7 only


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]