re PR other/47167 (Performance regression in numerical code)
authorRichard Guenther <rguenther@suse.de>
Thu, 20 Jan 2011 10:33:15 +0000 (10:33 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Thu, 20 Jan 2011 10:33:15 +0000 (10:33 +0000)
2011-01-20  Richard Guenther  <rguenther@suse.de>

PR tree-optimization/47167
* tree-ssa-copyrename.c (copy_rename_partition_coalesce):
Revert previous change, only avoid enumeral type changes.

From-SVN: r169050

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

index 51869a29a6584aa2dd5be9290b17213877f6af32..ff8645e610601a79bdde519ad95b62e77c878390 100644 (file)
@@ -1,3 +1,9 @@
+2011-01-20  Richard Guenther  <rguenther@suse.de>
+
+       PR tree-optimization/47167
+       * tree-ssa-copyrename.c (copy_rename_partition_coalesce):
+       Revert previous change, only avoid enumeral type changes.
+
 2011-01-19  Dodji Seketeli  <dodji@redhat.com>
 
        PR c++/47291
index abee6b9407fbabb74cf0adb64e1c1b1ab67485eb..9c51d118384c657cffbf3d91a591531bd739662b 100644 (file)
@@ -226,11 +226,16 @@ copy_rename_partition_coalesce (var_map map, tree var1, tree var2, FILE *debug)
       ign2 = false;
     }
 
-  /* Don't coalesce if the two variables are not of the same type.  */
-  if (TREE_TYPE (root1) != TREE_TYPE (root2))
+  /* Don't coalesce if the two variables aren't type compatible .  */
+  if (!types_compatible_p (TREE_TYPE (root1), TREE_TYPE (root2))
+      /* There is a disconnect between the middle-end type-system and
+         VRP, avoid coalescing enum types with different bounds.  */
+      || ((TREE_CODE (TREE_TYPE (root1)) == ENUMERAL_TYPE
+          || TREE_CODE (TREE_TYPE (root2)) == ENUMERAL_TYPE)
+         && TREE_TYPE (root1) != TREE_TYPE (root2)))
     {
       if (debug)
-       fprintf (debug, " : Different types.  No coalesce.\n");
+       fprintf (debug, " : Incompatible types.  No coalesce.\n");
       return false;
     }