aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorKazu Hirata <kazu@cs.umass.edu>2004-11-24 13:35:38 +0000
committerKazu Hirata <kazu@gcc.gnu.org>2004-11-24 13:35:38 +0000
commitac57c407193440ad22a87fa976d28dd450bd0bbf (patch)
tree3c3cdd437516470ac532a6b606a149015d5d0790 /gcc
parent9323afaec859608f99a56c9882f175245889b012 (diff)
downloadgcc-ac57c407193440ad22a87fa976d28dd450bd0bbf.zip
gcc-ac57c407193440ad22a87fa976d28dd450bd0bbf.tar.gz
gcc-ac57c407193440ad22a87fa976d28dd450bd0bbf.tar.bz2
tree-ssa-loop-manip.c (lv_adjust_loop_header_phi): Use find_edge to find the index of a PHI argument.
* tree-ssa-loop-manip.c (lv_adjust_loop_header_phi): Use find_edge to find the index of a PHI argument. From-SVN: r91155
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog3
-rw-r--r--gcc/tree-ssa-loop-manip.c12
2 files changed, 8 insertions, 7 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 9dd15b2..9afd037 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -3,6 +3,9 @@
* tree-ssa-pre.c (phi_translate): Use find_edge to find the
index of a PHI argument.
+ * tree-ssa-loop-manip.c (lv_adjust_loop_header_phi): Use
+ find_edge to find the index of a PHI argument.
+
2004-11-24 Steven Bosscher <stevenb@suse.de>
* expr.c (expand_expr_real_1): Remove cases for EXIT_BLOCK_EXPR
diff --git a/gcc/tree-ssa-loop-manip.c b/gcc/tree-ssa-loop-manip.c
index 4349956..3a87849 100644
--- a/gcc/tree-ssa-loop-manip.c
+++ b/gcc/tree-ssa-loop-manip.c
@@ -667,14 +667,12 @@ lv_adjust_loop_header_phi (basic_block first, basic_block second,
phi2 && phi1;
phi2 = PHI_CHAIN (phi2), phi1 = PHI_CHAIN (phi1))
{
- int i;
- for (i = 0; i < PHI_NUM_ARGS (phi2); i++)
+ edge e2 = find_edge (new_head, second);
+
+ if (e2)
{
- if (PHI_ARG_EDGE (phi2, i)->src == new_head)
- {
- tree def = PHI_ARG_DEF (phi2, i);
- add_phi_arg (&phi1, def, e);
- }
+ tree def = PHI_ARG_DEF (phi2, e2->dest_idx);
+ add_phi_arg (&phi1, def, e);
}
}
}