> 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 ;) I wonder about the following test few lines bellow: /* Offset 0 indicates the primary base, whose vtable contents are represented in the binfo for the derived class. */ else if (offset != 0) { tree base_binfo, found_binfo = NULL_TREE; for (i = 0; BINFO_BASE_ITERATE (binfo, i, base_binfo); i++) if (TREE_TYPE (base_binfo) == TREE_TYPE (fld))
don't we want also more relaxed testing? "grep "TYPE.* ==.*TYPE " *.c" seems to show some extra dubious cases i.e. in fold-const, tree-ssa-coaelesce and other places where we most probably care only about semantical equivalence of the type... Thanks for looking into this! Honza