summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-sink.c
diff options
context:
space:
mode:
authorkazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4>2005-04-06 17:41:11 +0000
committerkazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4>2005-04-06 17:41:11 +0000
commit737b5433db287af159d307bea36b7e0d8f0d0f25 (patch)
treec730733e13b2334b33134f79622bb07ecdf4a2a4 /gcc/tree-ssa-sink.c
parent646a7d4a4bdb6444f1834c9aa45489cb0396c348 (diff)
downloadgcc-737b5433db287af159d307bea36b7e0d8f0d0f25.tar.gz
* tree-ssa-sink.c (nearest_common_dominator_of_uses): Look at
a PHI argument where a use occurs instead of all PHI arguments. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@97738 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-sink.c')
-rw-r--r--gcc/tree-ssa-sink.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/tree-ssa-sink.c b/gcc/tree-ssa-sink.c
index c8785de9e17..cecbae7a74f 100644
--- a/gcc/tree-ssa-sink.c
+++ b/gcc/tree-ssa-sink.c
@@ -240,10 +240,10 @@ nearest_common_dominator_of_uses (tree stmt)
basic_block useblock;
if (TREE_CODE (usestmt) == PHI_NODE)
{
- int j;
- for (j = 0; j < PHI_NUM_ARGS (usestmt); j++)
+ int idx = PHI_ARG_INDEX_FROM_USE (use_p);
+ if (PHI_ARG_DEF (usestmt, idx) == var)
{
- useblock = PHI_ARG_EDGE (usestmt, j)->src;
+ useblock = PHI_ARG_EDGE (usestmt, idx)->src;
/* Short circuit. Nothing dominates the entry block. */
if (useblock == ENTRY_BLOCK_PTR)
{