summaryrefslogtreecommitdiff
path: root/gcc/tree-phinodes.c
diff options
context:
space:
mode:
authorkazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4>2004-11-02 13:23:05 +0000
committerkazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4>2004-11-02 13:23:05 +0000
commit2a6e956aa056865d3647533dc1bc9c388321e926 (patch)
tree7091abf3b32a0579cf01c68d71ac82ff7bb67e7b /gcc/tree-phinodes.c
parent36fddb4bfb031111da227b2bf1f34317f2599b55 (diff)
downloadgcc-2a6e956aa056865d3647533dc1bc9c388321e926.tar.gz
* tree-phinodes.c (add_phi_arg): Add an assertion that the
edge already exists. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@89985 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-phinodes.c')
-rw-r--r--gcc/tree-phinodes.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/gcc/tree-phinodes.c b/gcc/tree-phinodes.c
index e7883e3951c..ba46c786459 100644
--- a/gcc/tree-phinodes.c
+++ b/gcc/tree-phinodes.c
@@ -295,12 +295,14 @@ create_phi_node (tree var, basic_block bb)
void
add_phi_arg (tree *phi, tree def, edge e)
{
+ basic_block bb = e->dest;
int i = PHI_NUM_ARGS (*phi);
+ gcc_assert (bb == bb_for_stmt (*phi));
+
if (i >= PHI_ARG_CAPACITY (*phi))
{
tree old_phi = *phi;
- basic_block bb;
/* Resize the phi. Unfortunately, this will relocate it. */
resize_phi_node (phi, ideal_phi_node_len (i + 4));
@@ -311,13 +313,6 @@ add_phi_arg (tree *phi, tree def, edge e)
/* The result of the phi is defined by this phi node. */
SSA_NAME_DEF_STMT (PHI_RESULT (*phi)) = *phi;
- /* Extract the basic block for the PHI from the PHI's annotation
- rather than the edge. This works better as the edge's
- destination may not currently be the block with the PHI node
- if we are in the process of threading the edge to a new
- destination. */
- bb = bb_for_stmt (*phi);
-
release_phi_node (old_phi);
/* Update the list head if replacing the first listed phi. */