+2004-09-13 Andrew MacLeod <amacleod@redhat.com>
+
+ PR tree-optimization/17400
+ * tree-ssa-copyrename.c (copy_rename_partition_coalesce): Don't
+ coalesce partitions when one occurs in an abnormal PHI.
+
2004-09-13 Andrew Pinski <apinski@apple.com>
* config/rs6000/darwin.h (ASM_OUTPUT_COMMON): Change variable size's
{
int p1, p2, p3;
tree root1, root2;
+ tree rep1, rep2;
var_ann_t ann1, ann2, ann3;
- bool ign1, ign2;
+ bool ign1, ign2, abnorm;
gcc_assert (TREE_CODE (var1) == SSA_NAME);
gcc_assert (TREE_CODE (var2) == SSA_NAME);
gcc_assert (p1 != NO_PARTITION);
gcc_assert (p2 != NO_PARTITION);
- root1 = SSA_NAME_VAR (partition_to_var (map, p1));
- root2 = SSA_NAME_VAR (partition_to_var (map, p2));
+ rep1 = partition_to_var (map, p1);
+ rep2 = partition_to_var (map, p2);
+ root1 = SSA_NAME_VAR (rep1);
+ root2 = SSA_NAME_VAR (rep2);
if (DECL_HARD_REGISTER (root1) || DECL_HARD_REGISTER (root2))
{
return;
}
+ /* Don't coalesce if one of the variables occurs in an abnormal PHI. */
+ abnorm = (SSA_NAME_OCCURS_IN_ABNORMAL_PHI (rep1)
+ || SSA_NAME_OCCURS_IN_ABNORMAL_PHI (rep2));
+ if (abnorm)
+ {
+ if (debug)
+ fprintf (debug, " : Abnormal PHI barrier. No coalesce.\n");
+ return;
+ }
+
/* Merge the two partitions. */
p3 = partition_union (map->var_partition, p1, p2);