From a78e238e4813c26f7119f8ef472de3e43a0d73e1 Mon Sep 17 00:00:00 2001 From: Andrew MacLeod Date: Mon, 13 Sep 2004 19:12:14 +0000 Subject: [PATCH] re PR tree-optimization/17400 (out of SSA corruption) 2004-09-13 Andrew MacLeod PR tree-optimization/17400 * tree-ssa-copyrename.c (copy_rename_partition_coalesce): Don't coalesce partitions when one occurs in an abnormal PHI. From-SVN: r87443 --- gcc/ChangeLog | 6 ++++++ gcc/tree-ssa-copyrename.c | 19 ++++++++++++++++--- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 20a989aa76b..fdb55745f32 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2004-09-13 Andrew MacLeod + + 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 * config/rs6000/darwin.h (ASM_OUTPUT_COMMON): Change variable size's diff --git a/gcc/tree-ssa-copyrename.c b/gcc/tree-ssa-copyrename.c index 4f95d20e569..494e3a57dd5 100644 --- a/gcc/tree-ssa-copyrename.c +++ b/gcc/tree-ssa-copyrename.c @@ -116,8 +116,9 @@ copy_rename_partition_coalesce (var_map map, tree var1, tree var2, FILE *debug) { 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); @@ -140,8 +141,10 @@ copy_rename_partition_coalesce (var_map map, tree var1, tree var2, FILE *debug) 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)) { @@ -248,6 +251,16 @@ copy_rename_partition_coalesce (var_map map, tree var1, tree var2, FILE *debug) 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); -- 2.30.2