This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: TYPE_BINFO and canonical types at LTO
- From: Richard Biener <rguenther at suse dot de>
- To: Jan Hubicka <hubicka at ucw dot cz>
- Cc: gcc at gcc dot gnu dot org, jason at redhat dot com
- Date: Tue, 18 Feb 2014 11:41:32 +0100 (CET)
- Subject: Re: TYPE_BINFO and canonical types at LTO
- Authentication-results: sourceware.org; auth=none
- References: <20140214004827 dot GA30858 at kam dot mff dot cuni dot cz> <alpine dot LSU dot 2 dot 11 dot 1402140937310 dot 1593 at zhemvz dot fhfr dot qr> <20140214165219 dot GA3380 at kam dot mff dot cuni dot cz> <alpine dot LSU dot 2 dot 11 dot 1402151058590 dot 1593 at zhemvz dot fhfr dot qr> <20140216235524 dot GA27760 at kam dot mff dot cuni dot cz> <alpine dot LSU dot 2 dot 11 dot 1402171220500 dot 1593 at zhemvz dot fhfr dot qr> <20140217205542 dot GB28729 at kam dot mff dot cuni dot cz> <alpine dot LSU dot 2 dot 11 dot 1402180943190 dot 1593 at zhemvz dot fhfr dot qr>
On Tue, 18 Feb 2014, Richard Biener wrote:
> On Mon, 17 Feb 2014, Jan Hubicka wrote:
>
> > >
> > > Yeah, ok. But we treat those types (B and C) TBAA equivalent because
> > > structurally they are the same ;) Luckily C has a "proper" field
> > > for its base (proper means that offset and size are correct as well
> > > as the type). It indeed has DECL_ARTIFICIAL set and yes, we treat
> > > those as "real" fields when doing the structural comparison.
> >
> > Yep, the difference is that depending if C or D win, we will end up walking the
> > BINFO or not. So we should not depend on the BINFo walk for correctness.
> > >
> > > More interesting is of course when we can re-use tail-padding in
> > > one but not the other (works as expected - not merged).
> >
> > Yep.
> > >
> > > struct A { A (); short x; bool a;};
> > > struct C:A { bool b; };
> > > struct B {struct A a; bool b;};
> > > struct C *p2;
> > > struct B *p1;
> > > int
> > > t()
> > > {
> > > p1->a.a = 2;
> > > return p2->a;
> > > }
> > >
> > > > Yes, zero sized classes are those having no fields (but other stuff,
> > > > type decls, bases etc.)
> > >
> > > Yeah, but TBAA obviously doesn't care about type decls and bases.
> >
> > So I guess the conclussion is that the BINFO walk in alias.c is pointless?
>
> Yes. But as I said - I remember being there and proposing to remove
> it. Some N > 5 years ago or so and it was either rejected or it didn't
> work out ;)
Btw, a bootstrap & regtest worked fine with removing that loop
(not that this proves anything).
Richard.