Commit bc2dce32 by Kazu Hirata Committed by Kazu Hirata

tree-phinodes.c (add_phi_arg): Add an assertion that the edge already exists.

	* tree-phinodes.c (add_phi_arg): Add an assertion that the
	edge already exists.

From-SVN: r89985
parent 54699c02
2004-11-02 Kazu Hirata <kazu@cs.umass.edu> 2004-11-02 Kazu Hirata <kazu@cs.umass.edu>
* tree-phinodes.c (add_phi_arg): Add an assertion that the
edge already exists.
2004-11-02 Kazu Hirata <kazu@cs.umass.edu>
* tree-phinodes.c (remove_phi_arg_num): Do not zero the * tree-phinodes.c (remove_phi_arg_num): Do not zero the
element that's being removed. element that's being removed.
......
...@@ -295,12 +295,14 @@ create_phi_node (tree var, basic_block bb) ...@@ -295,12 +295,14 @@ create_phi_node (tree var, basic_block bb)
void void
add_phi_arg (tree *phi, tree def, edge e) add_phi_arg (tree *phi, tree def, edge e)
{ {
basic_block bb = e->dest;
int i = PHI_NUM_ARGS (*phi); int i = PHI_NUM_ARGS (*phi);
gcc_assert (bb == bb_for_stmt (*phi));
if (i >= PHI_ARG_CAPACITY (*phi)) if (i >= PHI_ARG_CAPACITY (*phi))
{ {
tree old_phi = *phi; tree old_phi = *phi;
basic_block bb;
/* Resize the phi. Unfortunately, this will relocate it. */ /* Resize the phi. Unfortunately, this will relocate it. */
resize_phi_node (phi, ideal_phi_node_len (i + 4)); resize_phi_node (phi, ideal_phi_node_len (i + 4));
...@@ -311,13 +313,6 @@ add_phi_arg (tree *phi, tree def, edge e) ...@@ -311,13 +313,6 @@ add_phi_arg (tree *phi, tree def, edge e)
/* The result of the phi is defined by this phi node. */ /* The result of the phi is defined by this phi node. */
SSA_NAME_DEF_STMT (PHI_RESULT (*phi)) = *phi; 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); release_phi_node (old_phi);
/* Update the list head if replacing the first listed phi. */ /* Update the list head if replacing the first listed phi. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment