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 c/65892] gcc fails to implement N685 aliasing of union members


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65892

--- Comment #17 from Martin Sebor <msebor at gcc dot gnu.org> ---
The C Union Visibility rule was intended to cover that case.  The trouble is
that the rule tends to be interpreted differently by different people, users
and implementers alike: Is it the union object that must be visible at the
point of the access, or just the union type?  Must the access be performed
using the union object, or just the union type, or neither?  There are
implementations that apparently disable aliasing at the first sight of a union
in a translation unit.  There are others that only disable it for structs used
in a union.  And others still that don't do anything special unless the aliased
object is accessed through the union itself.

There are also aliasing problems beyond unions that affect both languages. 
WG14 N1520 referenced in comment #10 gives a few scary examples.  This still
needs to be resolved.  (I haven't talked to Clark since Lenexa so unless he's
made progress on the issue the new paper I mentioned in comment #10 will have
to wait until 2016.)


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