aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa.c
diff options
context:
space:
mode:
authorKazu Hirata <kazu@cs.umass.edu>2004-11-23 17:45:50 +0000
committerKazu Hirata <kazu@cs.umass.edu>2004-11-23 17:45:50 +0000
commitda320e2636ce4fb55c3ea4cf2d8065add1b7deff (patch)
tree5276b730983237b937ef366760754e81460875fc /gcc/tree-ssa.c
parentd449aaf1ea4719bbb819e4a2c7e5a29b6502d4d4 (diff)
* tree-phinode.c (resize_phi_node): Abort when LEN is strictly
greater than PHI_ARG_CAPACITY. (reserve_phi_args_for_new_edge): Initialize the new PHI argument to NULL_TREE. Increment PHI_NUM_ARGS. (add_phi_arg): Add a PHI argument to the slot given by E->dest_idx. (remove_phi_arg_num): Do not write to PHI_ARG_EDGE. * tree-flow-inline (phi_arg_from_edge): Return E->dest_idx. * tree-ssa.c (ssa_redirect_edge): Check for a missing PHI argument by looking at PHI_ARG_DEF. (verify_phi_args): Check for a missing PHI argument. Remove the check for duplicate PHI arguments. * tree.h (PHI_ARG_EDGE): Redefine in terms of EDGE_PRED. (phi_arg_d): Remove e. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@91097 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa.c')
-rw-r--r--gcc/tree-ssa.c29
1 files changed, 12 insertions, 17 deletions
diff --git a/gcc/tree-ssa.c b/gcc/tree-ssa.c
index 67129771904..e2b23f01844 100644
--- a/gcc/tree-ssa.c
+++ b/gcc/tree-ssa.c
@@ -64,7 +64,7 @@ ssa_redirect_edge (edge e, basic_block dest)
next = PHI_CHAIN (phi);
i = phi_arg_from_edge (phi, e);
- if (i < 0)
+ if (PHI_ARG_DEF (phi, i) == NULL_TREE)
continue;
src = PHI_ARG_DEF (phi, i);
@@ -277,7 +277,6 @@ verify_phi_args (tree phi, basic_block bb, basic_block *definition_block)
edge e;
bool err = false;
unsigned i, phi_num_args = PHI_NUM_ARGS (phi);
- edge_iterator ei;
if (EDGE_COUNT (bb->preds) != phi_num_args)
{
@@ -286,22 +285,27 @@ verify_phi_args (tree phi, basic_block bb, basic_block *definition_block)
goto error;
}
- /* Mark all the incoming edges. */
- FOR_EACH_EDGE (e, ei, bb->preds)
- e->aux = (void *) 1;
-
for (i = 0; i < phi_num_args; i++)
{
tree op = PHI_ARG_DEF (phi, i);
+ e = PHI_ARG_EDGE (phi, i);
+
+ if (op == NULL_TREE)
+ {
+ error ("PHI argument is missing for edge %d->%d\n",
+ e->src->index,
+ e->dest->index);
+ err = true;
+ goto error;
+ }
+
if (TREE_CODE (op) != SSA_NAME && !is_gimple_min_invariant (op))
{
error ("PHI argument is not SSA_NAME, or invariant");
err = true;
}
- e = PHI_ARG_EDGE (phi, i);
-
if (TREE_CODE (op) == SSA_NAME)
err = verify_use (e->src, definition_block[SSA_NAME_VERSION (op)], op,
phi, e->flags & EDGE_ABNORMAL,
@@ -315,21 +319,12 @@ verify_phi_args (tree phi, basic_block bb, basic_block *definition_block)
err = true;
}
- if (e->aux == (void *) 0)
- {
- error ("PHI argument flowing through dead or duplicated edge %d->%d\n",
- e->src->index, e->dest->index);
- err = true;
- }
-
if (err)
{
fprintf (stderr, "PHI argument\n");
print_generic_stmt (stderr, op, TDF_VOPS);
goto error;
}
-
- e->aux = (void *) 0;
}
error: