diff options
author | Andrew MacLeod <amacleod@redhat.com> | 2004-09-13 19:12:14 +0000 |
---|---|---|
committer | Andrew Macleod <amacleod@gcc.gnu.org> | 2004-09-13 19:12:14 +0000 |
commit | a78e238e4813c26f7119f8ef472de3e43a0d73e1 (patch) | |
tree | 2f7b43c35cf997c3d702843b9eb5201fc91e0d85 /gcc/tree-ssa-copyrename.c | |
parent | 5547b98291d03422930c1124a599bd666bf2ae5b (diff) | |
download | gcc-a78e238e4813c26f7119f8ef472de3e43a0d73e1.zip gcc-a78e238e4813c26f7119f8ef472de3e43a0d73e1.tar.gz gcc-a78e238e4813c26f7119f8ef472de3e43a0d73e1.tar.bz2 |
re PR tree-optimization/17400 (out of SSA corruption)
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.
From-SVN: r87443
Diffstat (limited to 'gcc/tree-ssa-copyrename.c')
-rw-r--r-- | gcc/tree-ssa-copyrename.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/gcc/tree-ssa-copyrename.c b/gcc/tree-ssa-copyrename.c index 4f95d20..494e3a5 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); |