OSDN Git Service

PR c++/17868
[pf3gnuchains/gcc-fork.git] / gcc / tree-ssa-copyrename.c
index 49225d0..7495c6b 100644 (file)
@@ -146,19 +146,6 @@ copy_rename_partition_coalesce (var_map map, tree var1, tree var2, FILE *debug)
   root1 = SSA_NAME_VAR (rep1);
   root2 = SSA_NAME_VAR (rep2);
 
-  if (DECL_HARD_REGISTER (root1) || DECL_HARD_REGISTER (root2))
-    {
-      if (debug)
-        {
-         if (DECL_HARD_REGISTER (root1))
-           print_generic_expr (debug, var1, TDF_SLIM);
-         else
-           print_generic_expr (debug, var2, TDF_SLIM);
-         fprintf (debug, " is a hardware register.  No Coalescing.\n");
-       }
-      return;
-    }
-
   ann1 = var_ann (root1);
   ann2 = var_ann (root2);
 
@@ -261,6 +248,18 @@ copy_rename_partition_coalesce (var_map map, tree var1, tree var2, FILE *debug)
       return;
     }
 
+  /* Don't coalesce if the aliasing sets of the types are different.  */
+  if (POINTER_TYPE_P (TREE_TYPE (root1))
+      && POINTER_TYPE_P (TREE_TYPE (root2))
+      && get_alias_set (TREE_TYPE (TREE_TYPE (root1)))
+          != get_alias_set (TREE_TYPE (TREE_TYPE (root2))))
+    {
+      if (debug)
+       fprintf (debug, " : 2 different alasing sets. No coalesce.\n");
+      return;
+    }
+
+
   /* Merge the two partitions.  */
   p3 = partition_union (map->var_partition, p1, p2);