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.

Richard.

> 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?
>
>we most probably do, good catch.  I'll update the patch, re-test and
>commit it early next week unless someone objects.
>
>> 
>> "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...
>> 
>
>Yeah, examinig those is also probably a good idea.
>
>Thanks,
>
>Martin


Reply via email to