From 7fbeb6b82854facf61f97e56d0b678bc90318825 Mon Sep 17 00:00:00 2001 From: kazu Date: Thu, 2 Dec 2004 16:45:26 +0000 Subject: [PATCH] * tree-cfg.c (phi_alternatives_equal): Check that PHI_ARG_DEF is not null. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@91647 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 3 +++ gcc/tree-cfg.c | 9 +++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4793b244f82..5e1c3374e5c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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 * tree-eh.c: Revert yesterday's change. diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c index 8af27b9a94f..3e046194114 100644 --- a/gcc/tree-cfg.c +++ b/gcc/tree-cfg.c @@ -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); } } -- 2.11.4.GIT