diff options
author | amacleod <amacleod@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-09-13 19:12:14 +0000 |
---|---|---|
committer | amacleod <amacleod@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-09-13 19:12:14 +0000 |
commit | 548b5cd93adfce9404300d9254e6d4a8003454a5 (patch) | |
tree | 2f7b43c35cf997c3d702843b9eb5201fc91e0d85 /gcc/tree-ssa-copyrename.c | |
parent | 6dc4dde38919248a11ae0f1a120f33381b9ca5c8 (diff) | |
download | gcc-548b5cd93adfce9404300d9254e6d4a8003454a5.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@87443 138bc75d-0d04-0410-961f-82ee72b054a4
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 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); |