Hi,
this patch drops TYPE_METHOD_BASETYPE from hash_canonical_type.  It is not
compared by gimple_canonical_types_compatible_p and thus it can only
corrupt the hashtable by having two entries that are equal but having different
hash.

Theoretically we may want later distinguish the method pointer by basetypes,
but the THIS pointer has proper type anyway and this all makes sense only
if we start handling pointers properly. Definitely we will need to do that
in both functions, not only here.

Bootstrapped/regtested x86_64-linux, OK?

Honza

        * lto.c (hash_canonical_type): Do not hash TYPE_METHOD_BASETYPE.
Index: lto/lto.c
===================================================================
--- lto/lto.c   (revision 223490)
+++ lto/lto.c   (working copy)
@@ -372,10 +376,6 @@ hash_canonical_type (tree type)
       unsigned na;
       tree p;
 
-      /* For method types also incorporate their parent class.  */
-      if (TREE_CODE (type) == METHOD_TYPE)
-       iterative_hash_canonical_type (TYPE_METHOD_BASETYPE (type), hstate);
-
       iterative_hash_canonical_type (TREE_TYPE (type), hstate);
 
       for (p = TYPE_ARG_TYPES (type), na = 0; p; p = TREE_CHAIN (p))

Reply via email to