re PR middle-end/32639 (ptrmem1.C now ICE's on mainline)
authorRichard Guenther <rguenther@suse.de>
Thu, 5 Jul 2007 21:21:10 +0000 (21:21 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Thu, 5 Jul 2007 21:21:10 +0000 (21:21 +0000)
2007-07-05  Richard Guenther  <rguenther@suse.de>

PR middle-end/32639
* alias.c (get_alias_set): Tread METHOD_TYPE the same as
FUNCTION_TYPE.
* tree-ssa.c (useless_type_conversion_p): Check canonical
types early.

From-SVN: r126389

gcc/ChangeLog
gcc/alias.c
gcc/tree-ssa.c

index f661697718ffb2c3c5c2f1cc1a94af3afd55f95d..5a55a9cca84fa2b2340d1a442cf64ff4e046ddad 100644 (file)
@@ -1,3 +1,11 @@
+2007-07-05  Richard Guenther  <rguenther@suse.de>
+
+       PR middle-end/32639
+       * alias.c (get_alias_set): Tread METHOD_TYPE the same as
+       FUNCTION_TYPE.
+       * tree-ssa.c (useless_type_conversion_p): Check canonical
+       types early.
+
 2007-07-05 Anatoly Sokolov <aesok@post.ru>
 
        * config/avr/avr.md (zero_extendqihi2, zero_extendqisi2, 
index 7c258c7470e2bee63889f268407c31b2d42c2809..a47e2916a469e850c327c3e1793a5d3085db6bf0 100644 (file)
@@ -620,7 +620,8 @@ get_alias_set (tree t)
   /* There are no objects of FUNCTION_TYPE, so there's no point in
      using up an alias set for them.  (There are, of course, pointers
      and references to functions, but that's different.)  */
-  else if (TREE_CODE (t) == FUNCTION_TYPE)
+  else if (TREE_CODE (t) == FUNCTION_TYPE
+          || TREE_CODE (t) == METHOD_TYPE)
     set = 0;
 
   /* Unless the language specifies otherwise, let vector types alias
index 005d3fdcbdd26ff35c0d7773e95ed4d85e47989e..5e166525883ab1569eed772e536b3add62979b60 100644 (file)
@@ -920,6 +920,11 @@ useless_type_conversion_p (tree outer_type, tree inner_type)
   if (inner_type == outer_type)
     return true;
 
+  /* If we know the canonical types, compare them.  */
+  if (TYPE_CANONICAL (inner_type)
+      && TYPE_CANONICAL (inner_type) == TYPE_CANONICAL (outer_type))
+    return true;
+
   /* Changes in machine mode are never useless conversions.  */
   if (TYPE_MODE (inner_type) != TYPE_MODE (outer_type))
     return false;
@@ -1029,11 +1034,6 @@ useless_type_conversion_p (tree outer_type, tree inner_type)
       if (TREE_CODE (inner_type) != TREE_CODE (outer_type))
        return false;
 
-      /* If we know the canonical types, compare them.  */
-      if (TYPE_CANONICAL (inner_type)
-         && TYPE_CANONICAL (inner_type) == TYPE_CANONICAL (outer_type))
-       return true;
-
       /* ???  Add structural equivalence check.  */
 
       /* ???  This should eventually just return false.  */