tree-cfg.c (phi_alternatives_equal): Check that PHI_ARG_DEF is not null.
authorKazu Hirata <kazu@cs.umass.edu>
Thu, 2 Dec 2004 16:45:26 +0000 (16:45 +0000)
committerKazu Hirata <kazu@gcc.gnu.org>
Thu, 2 Dec 2004 16:45:26 +0000 (16:45 +0000)
* tree-cfg.c (phi_alternatives_equal): Check that PHI_ARG_DEF
is not null.

From-SVN: r91647

gcc/ChangeLog
gcc/tree-cfg.c

index 4793b244f823b3775be13bcf7cf4d4468c588281..5e1c3374e5c0986a1cd5ec87964b6ec95edd15ea 100644 (file)
@@ -3,6 +3,9 @@
        * tree-cfg.c (phi_alternatives_equal): Check that PHI_ARG_DEF
        is not null.
 
+       * tree-cfg.c (phi_alternatives_equal): Check that PHI_ARG_DEF
+       is not null.
+
 2004-12-02  Jeff Law  <law@redhat.com>
 
        * tree-eh.c: Revert yesterday's change.
index 8af27b9a94fff63a8d154b783d4bcbc75331e863..3e046194114d2017be846444897804aa5c2f2470 100644 (file)
@@ -3941,7 +3941,6 @@ thread_jumps_from_bb (basic_block bb)
       edge last, old;
       basic_block dest, tmp, curr, old_dest;
       tree phi;
-      int arg;
 
       /* If the edge is abnormal or its destination is not
         forwardable, then there's nothing to do.  */
@@ -4028,11 +4027,13 @@ thread_jumps_from_bb (basic_block bb)
             have the same value as the argument associated with LAST.
             Otherwise we would have changed our target block
             above.  */
+         int arg = last->dest_idx;
+
          for (phi = phi_nodes (dest); phi; phi = PHI_CHAIN (phi))
            {
-             arg = phi_arg_from_edge (phi, last);
-             gcc_assert (arg >= 0);
-             add_phi_arg (phi, PHI_ARG_DEF (phi, arg), e);
+             tree def = PHI_ARG_DEF (phi, arg);
+             gcc_assert (def != NULL_TREE);
+             add_phi_arg (phi, def, e);
            }
        }