tree-ssa-sink.c (nearest_common_dominator_of_uses): Look at a PHI argument where...
authorKazu Hirata <kazu@cs.umass.edu>
Wed, 6 Apr 2005 17:41:11 +0000 (17:41 +0000)
committerKazu Hirata <kazu@gcc.gnu.org>
Wed, 6 Apr 2005 17:41:11 +0000 (17:41 +0000)
* 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

gcc/ChangeLog
gcc/tree-ssa-sink.c

index 6d1882a583f86a143e3f3b1b9a97da25c074d7d0..f8417dc2b3f30ec698d2f8077a39bd2fe746710f 100644 (file)
@@ -1,3 +1,8 @@
+2005-04-06  Kazu Hirata  <kazu@cs.umass.edu>
+
+       * 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  <joseph@codesourcery.com>
 
        * c-decl.c (finish_decl): Apply pending #pragma weak regardless of
index c8785de9e17d44f6024d05adb20cedb54d827369..cecbae7a74f27b0c2b0a04734c560dad87eb4c95 100644 (file)
@@ -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)
                    {