From: Kazu Hirata Date: Wed, 6 Apr 2005 17:41:11 +0000 (+0000) Subject: tree-ssa-sink.c (nearest_common_dominator_of_uses): Look at a PHI argument where... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=55b12f0d74eb9fa1e9da0f0848f9615c7c20a8a7;p=gcc.git tree-ssa-sink.c (nearest_common_dominator_of_uses): Look at a PHI argument where a use occurs instead of all PHI arguments. * tree-ssa-sink.c (nearest_common_dominator_of_uses): Look at a PHI argument where a use occurs instead of all PHI arguments. From-SVN: r97738 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6d1882a583f..f8417dc2b3f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2005-04-06 Kazu Hirata + + * tree-ssa-sink.c (nearest_common_dominator_of_uses): Look at + a PHI argument where a use occurs instead of all PHI arguments. + 2005-04-06 Joseph S. Myers * c-decl.c (finish_decl): Apply pending #pragma weak regardless of 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) {