Jan Hubicka <hubi...@ucw.cz> wrote: >> Martin Jambor <mjam...@suse.cz> wrote: >> >> >Hi, >> > >> >On Fri, May 10, 2013 at 07:24:06PM +0200, Jan Hubicka wrote: >> >> > 2013-05-10 Martin Jambor <mjam...@suse.cz> >> >> > >> >> > * tree.c (get_binfo_at_offset): Use types_compatible_p to >compare >> >> > types. >> >> > >> >> > Index: src/gcc/tree.c >> >> > >=================================================================== >> >> > --- src.orig/gcc/tree.c >> >> > +++ src/gcc/tree.c >> >> > @@ -11483,7 +11483,7 @@ get_binfo_at_offset (tree binfo, HOST_WI >> >> > tree fld; >> >> > int i; >> >> > >> >> > - if (TYPE_MAIN_VARIANT (type) == TYPE_MAIN_VARIANT >> >(expected_type)) >> >> > + if (types_compatible_p (type, expected_type)) >> >> As discussed on lunch, it seems fine to me, but I am not an expert >;) >> >> This doesn't look good to me. With lto all types that are >structurally equivalent will compare compatible this way. Probably not >what you want. > >Yep, that was my concern, too. I wonder how to recognize the two types >represent the same object. Perhaps by adding an assiciated vtable (via >binfos) >into the structural match while merging?
The existing check should work ok with lto. If not then we should figure out why we do not merge the main variants properly. Richard. >Honza