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++/61004] [4.10 Regression] Spurious warning: dereferencing type-punned pointer


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=61004

--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
B doesn't have a FIELD_DECL for its base A, not sure why.  If we make A
non-empty
we get

  f ((const struct A &) (const struct A *) &b.D.2231)

with empty A (and no field for it) we get

  f ((const struct A &) (const struct A *) &b)

I suppose this is to avoid having two fields at the same offset if we
make B not empty.

Now, that we don't record the alias-set of A as subset of that of B isn't
a problem in practice but for the (IMHO completely bogus) implementation
of our strict-aliasing warnings.


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