This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [lno] ICE in coalesce_abnormal_edges, at tree-outof-ssa.c:645
Hello,
> > It obviously might spoil the code if there were too many such stores
> > emited, but it seems to me that it might well turn that this is rare, in
> > which case it would be much nicer solution than the current one where we
> > have to check & update the SSA_NAME_OCCURS_IN_ABNORMAL_EDGE everywhere.
> >
> I hate the SSA_NAME_OCCURS_IN_ABNORMAL_EDGE stuff. We introduced it
> because it was happening with great regularity. copy propagation caused
> it to happen a lot. I beleive some other optimizations made it happen
> quite frequently as well.
>
> I had toyed with the idea of adding an option which would generate the
> required temporaries, but when I went to do so, I ran into a
> problem/complication. I forget what it was, and I simply never got back
> to it.
this seems to work just fine. I have however did not get to check the
performance of the produced code. Is there some benchmark that could be
used to test this? Specs does not seem to be good for this, since almost
all tests are c/fortran, i.e. probably without any significant number of
abnormal edges.
The other idea I am toying with is the possibility to teach gcc to
insert code on exception handling edges, which would reduce the problem
to nearly nonexistent. The main problem here seems to be that I could
not find any documentation for how exception handling is done in gcc,
and the whole except.c/tree-eh.c stuff is hard to understand without it.
Zdenek
Index: tree-cfg.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-cfg.c,v
retrieving revision 1.1.4.280
diff -c -3 -p -r1.1.4.280 tree-cfg.c
*** tree-cfg.c 3 Apr 2004 11:12:00 -0000 1.1.4.280
--- tree-cfg.c 21 Apr 2004 20:47:27 -0000
*************** static struct cfg_stats_d cfg_stats;
*** 67,81 ****
/* Nonzero if we found a computed goto while building basic blocks. */
static bool found_computed_goto;
- /* If we found computed gotos, then they are all revectored to this
- location. We try to unfactor them after we have translated out
- of SSA form. */
- static GTY(()) tree factored_computed_goto_label;
-
- /* The factored computed goto. We cache this so we can easily recover
- the destination of computed gotos when unfactoring them. */
- static GTY(()) tree factored_computed_goto;
-
/* Basic blocks and flowgraphs. */
static basic_block create_bb (void *, void *, basic_block);
static void create_block_annotation (basic_block);
--- 67,72 ----
*************** static void free_blocks_annotations (voi
*** 83,89 ****
static void clear_blocks_annotations (void);
static void make_blocks (tree);
static void factor_computed_gotos (void);
- static tree tree_block_label (basic_block bb);
/* Edges. */
static void make_edges (void);
--- 74,79 ----
*************** factor_computed_gotos (void)
*** 223,228 ****
--- 213,220 ----
basic_block bb;
tree factored_label_decl = NULL;
tree var = NULL;
+ tree factored_computed_goto_label = NULL;
+ tree factored_computed_goto = NULL;
/* We know there are one or more computed gotos in this function.
Examine the last statement in each basic block to see if the block
*************** disband_implicit_edges (void)
*** 2457,2463 ****
basic_block bb;
block_stmt_iterator last;
edge e;
! tree stmt, label;
FOR_EACH_BB (bb)
{
--- 2449,2455 ----
basic_block bb;
block_stmt_iterator last;
edge e;
! tree stmt, label, forward;
FOR_EACH_BB (bb)
{
*************** disband_implicit_edges (void)
*** 2524,2543 ****
label = tree_block_label (e->dest);
! /* ??? Why bother putting this back together when rtl is just
about to take it apart again? */
! if (factored_computed_goto_label
! && label == LABEL_EXPR_LABEL (factored_computed_goto_label))
! label = GOTO_DESTINATION (factored_computed_goto);
bsi_insert_after (&last,
build1 (GOTO_EXPR, void_type_node, label),
BSI_NEW_STMT);
e->flags &= ~EDGE_FALLTHRU;
}
-
- factored_computed_goto = NULL;
- factored_computed_goto_label = NULL;
}
--- 2516,2535 ----
label = tree_block_label (e->dest);
! /* If this is a goto to a goto, jump to the final destination.
! Handles unfactoring of the computed jumps.
! ??? Why bother putting this back together when rtl is just
about to take it apart again? */
! forward = last_and_only_stmt (e->dest);
! if (forward
! && TREE_CODE (forward) == GOTO_EXPR)
! label = GOTO_DESTINATION (forward);
bsi_insert_after (&last,
build1 (GOTO_EXPR, void_type_node, label),
BSI_NEW_STMT);
e->flags &= ~EDGE_FALLTHRU;
}
}
*************** thread_jumps (void)
*** 3795,3801 ****
/* Return a non-special label in the head of basic block BLOCK.
Create one if it doesn't exist. */
! static tree
tree_block_label (basic_block bb)
{
block_stmt_iterator i, s = bsi_start (bb);
--- 3787,3793 ----
/* Return a non-special label in the head of basic block BLOCK.
Create one if it doesn't exist. */
! tree
tree_block_label (basic_block bb)
{
block_stmt_iterator i, s = bsi_start (bb);
Index: tree-flow-inline.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-flow-inline.h,v
retrieving revision 1.1.2.68
diff -c -3 -p -r1.1.2.68 tree-flow-inline.h
*** tree-flow-inline.h 9 Mar 2004 18:27:56 -0000 1.1.2.68
--- tree-flow-inline.h 21 Apr 2004 20:47:27 -0000
*************** may_propagate_copy (tree dest, tree orig
*** 462,471 ****
return false;
}
! return (!SSA_NAME_OCCURS_IN_ABNORMAL_PHI (dest)
! && (TREE_CODE (orig) != SSA_NAME
! || !SSA_NAME_OCCURS_IN_ABNORMAL_PHI (orig))
! && !DECL_HARD_REGISTER (SSA_NAME_VAR (dest)));
}
static inline void
--- 462,468 ----
return false;
}
! return !DECL_HARD_REGISTER (SSA_NAME_VAR (dest));
}
static inline void
*************** bsi_start (basic_block bb)
*** 518,523 ****
--- 515,559 ----
bsi.tsi.container = NULL;
}
bsi.bb = bb;
+ return bsi;
+ }
+
+ static inline block_stmt_iterator
+ bsi_after_labels (basic_block bb)
+ {
+ block_stmt_iterator bsi;
+ tree_stmt_iterator next;
+
+ bsi.bb = bb;
+
+ if (!bb->stmt_list)
+ {
+ #ifdef ENABLE_CHECKING
+ if (bb->index >= 0)
+ abort ();
+ #endif
+ bsi.tsi.ptr = NULL;
+ bsi.tsi.container = NULL;
+ return bsi;
+ }
+
+ /* Ensure that there are some labels. The rationale is that we want
+ to insert after the bsi that is returned, and these insertions should
+ be placed at the start of the basic block. This would not work if the
+ first statement was not label. */
+ tree_block_label (bb);
+
+ bsi.tsi = tsi_start (bb->stmt_list);
+ next = bsi.tsi;
+ tsi_next (&next);
+
+ while (!tsi_end_p (next)
+ && TREE_CODE (tsi_stmt (next)) == LABEL_EXPR)
+ {
+ bsi.tsi = next;
+ tsi_next (&next);
+ }
+
return bsi;
}
Index: tree-flow.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-flow.h,v
retrieving revision 1.1.4.200
diff -c -3 -p -r1.1.4.200 tree-flow.h
*** tree-flow.h 6 Apr 2004 22:14:49 -0000 1.1.4.200
--- tree-flow.h 21 Apr 2004 20:47:27 -0000
*************** typedef struct {
*** 398,403 ****
--- 398,404 ----
} block_stmt_iterator;
static inline block_stmt_iterator bsi_start (basic_block);
+ static inline block_stmt_iterator bsi_after_labels (basic_block);
static inline block_stmt_iterator bsi_last (basic_block);
static inline bool bsi_end_p (block_stmt_iterator);
static inline void bsi_next (block_stmt_iterator *);
*************** extern edge find_taken_edge (basic_block
*** 461,466 ****
--- 462,468 ----
extern void cfg_remove_useless_stmts (void);
extern edge thread_edge (edge, basic_block);
extern basic_block label_to_block (tree);
+ extern tree tree_block_label (basic_block);
extern void tree_optimize_tail_calls (bool, enum tree_dump_index);
extern edge tree_block_forwards_to (basic_block bb);
extern void bsi_insert_on_edge (edge, tree);
Index: tree-outof-ssa.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-outof-ssa.c,v
retrieving revision 1.1.2.4
diff -c -3 -p -r1.1.2.4 tree-outof-ssa.c
*** tree-outof-ssa.c 16 Apr 2004 17:13:36 -0000 1.1.2.4
--- tree-outof-ssa.c 21 Apr 2004 20:47:27 -0000
*************** create_temp (tree t)
*** 170,196 ****
static void
insert_copy_on_edge (edge e, tree dest, tree src)
{
! tree copy;
- copy = build (MODIFY_EXPR, TREE_TYPE (dest), dest, src);
set_is_used (dest);
if (TREE_CODE (src) == ADDR_EXPR)
src = TREE_OPERAND (src, 0);
if (TREE_CODE (src) == VAR_DECL || TREE_CODE (src) == PARM_DECL)
set_is_used (src);
-
- if (dump_file && (dump_flags & TDF_DETAILS))
- {
- fprintf (dump_file,
- "Inserting a copy on edge BB%d->BB%d :",
- e->src->index,
- e->dest->index);
- print_generic_expr (dump_file, copy, dump_flags);
- fprintf (dump_file, "\n");
- }
-
- bsi_insert_on_edge (e, copy);
}
--- 170,222 ----
static void
insert_copy_on_edge (edge e, tree dest, tree src)
{
! tree copy = build (MODIFY_EXPR, TREE_TYPE (dest), dest, src);
!
! if (e->flags & EDGE_ABNORMAL)
! {
! block_stmt_iterator bsi;
!
! /* If E is abnormal, we have to store the value to the temporary passed
! to us in DEST and place the store at the end of the source block. */
!
! if (dump_file && (dump_flags & TDF_DETAILS))
! {
! fprintf (dump_file,
! "Inserting a store to temporary for abnormal edge BB%d->BB%d :",
! e->src->index,
! e->dest->index);
! print_generic_expr (dump_file, copy, dump_flags);
! fprintf (dump_file, "\n");
! }
!
! bsi = bsi_last (e->src);
! if (bsi_end_p (bsi)
! || !stmt_ends_bb_p (bsi_stmt (bsi)))
! bsi_insert_after (&bsi, copy, BSI_NEW_STMT);
! else
! bsi_insert_before (&bsi, copy, BSI_NEW_STMT);
! }
! else
! {
! if (dump_file && (dump_flags & TDF_DETAILS))
! {
! fprintf (dump_file,
! "Inserting a copy on edge BB%d->BB%d :",
! e->src->index,
! e->dest->index);
! print_generic_expr (dump_file, copy, dump_flags);
! fprintf (dump_file, "\n");
! }
!
! bsi_insert_on_edge (e, copy);
! }
set_is_used (dest);
if (TREE_CODE (src) == ADDR_EXPR)
src = TREE_OPERAND (src, 0);
if (TREE_CODE (src) == VAR_DECL || TREE_CODE (src) == PARM_DECL)
set_is_used (src);
}
*************** eliminate_phi (edge e, int i, elim_graph
*** 506,511 ****
--- 532,540 ----
int x;
basic_block B = e->dest;
+ if (e->flags & EDGE_ABNORMAL)
+ abort ();
+
#if defined ENABLE_CHECKING
if (i == -1)
abort ();
*************** eliminate_phi (edge e, int i, elim_graph
*** 513,523 ****
abort ();
#endif
- /* Abnormal edges already have everything coalesced, or the coalescer
- would have aborted. */
- if (e->flags & EDGE_ABNORMAL)
- return;
-
num_nodes = num_var_partitions (g->map);
g->e = e;
--- 542,547 ----
*************** eliminate_phi (edge e, int i, elim_graph
*** 558,563 ****
--- 582,660 ----
}
}
+ /* Eliminate the phi node PHI such that some of the predecessor edges
+ is abnormal. */
+
+ static void
+ eliminate_abnormal_phi (tree phi, elim_graph g)
+ {
+ tree dest, tmp_var = NULL_TREE, src, copy;
+ int pi;
+ edge e;
+ block_stmt_iterator bsi;
+
+ dest = var_to_partition_to_var (g->map, PHI_RESULT (phi));
+
+ /* Ignore results which are not in partitions. */
+ if (dest == NULL_TREE)
+ {
+ #ifdef ENABLE_CHECKING
+ /* There should be no arguments of this PHI which are in
+ the partition list, or we get incorrect results. */
+ for (pi = 0; pi < PHI_NUM_ARGS (phi); pi++)
+ {
+ tree arg = PHI_ARG_DEF (phi, pi);
+ if (TREE_CODE (arg) == SSA_NAME
+ && var_to_partition (g->map, arg) != NO_PARTITION)
+ {
+ fprintf (stderr, "Argument of PHI is in a partition :(");
+ print_generic_expr (stderr, arg, TDF_SLIM);
+ fprintf (stderr, "), but the result is not :");
+ print_generic_stmt (stderr, phi, TDF_SLIM);
+ abort();
+ }
+ }
+ #endif
+ return;
+ }
+
+ for (pi = 0; pi < PHI_NUM_ARGS (phi); pi++)
+ {
+ src = PHI_ARG_DEF (phi, pi);
+
+ if (!phi_ssa_name_p (src)
+ || var_to_partition_to_var (g->map, src) != dest)
+ {
+ /* Create the temporary and emit load from it to the start of
+ the target block. */
+ tmp_var = create_temp (dest);
+ copy = build (MODIFY_EXPR, TREE_TYPE (dest), dest, tmp_var);
+ bsi = bsi_after_labels (bb_for_stmt (phi));
+ bsi_insert_after (&bsi, copy, BSI_NEW_STMT);
+ break;
+ }
+ }
+
+ /* The names were succesfully coalesced, nothing to do. */
+ if (!tmp_var)
+ return;
+
+ for (pi = 0; pi < PHI_NUM_ARGS (phi); pi++)
+ {
+ e = PHI_ARG_EDGE (phi, pi);
+ src = PHI_ARG_DEF (phi, pi);
+
+ /* If this argument is a constant, or a SSA_NAME which is being
+ left in SSA form, just queue a copy to be emitted on this
+ edge. */
+ if (phi_ssa_name_p (src)
+ && var_to_partition (g->map, src) != NO_PARTITION)
+ src = var_to_partition_to_var (g->map, src);
+
+ insert_copy_on_edge (e, tmp_var, src);
+ }
+ }
+
/* Shortcut routine to print messages to file F of the form:
"STR1 EXPR1 STR2 EXPR2 STR3." */
*************** coalesce_abnormal_edges (var_map map, co
*** 625,645 ****
tmp = PHI_ARG_DEF (phi, y);
if (!phi_ssa_name_p (tmp))
{
! print_exprs_edge (stderr, e,
! "\nConstant argument in PHI. Can't insert :",
! var, " = ", tmp);
! abort ();
}
y = var_to_partition (map, tmp);
if (x == NO_PARTITION || y == NO_PARTITION)
abort ();
if (root_var_find (rv, x) != root_var_find (rv, y))
{
! print_exprs_edge (stderr, e, "\nDifferent root vars: ",
! root_var (rv, root_var_find (rv, x)),
! " and ",
! root_var (rv, root_var_find (rv, y)));
! abort ();
}
if (x != y)
--- 722,737 ----
tmp = PHI_ARG_DEF (phi, y);
if (!phi_ssa_name_p (tmp))
{
! /* Constant argument in PHI, cannot coalesce. */
! continue;
}
y = var_to_partition (map, tmp);
if (x == NO_PARTITION || y == NO_PARTITION)
abort ();
if (root_var_find (rv, x) != root_var_find (rv, y))
{
! /* Different root vars, cannot coalesce. */
! continue;
}
if (x != y)
*************** coalesce_abnormal_edges (var_map map, co
*** 658,676 ****
}
if (var_union (map, var, tmp) == NO_PARTITION)
{
! print_exprs_edge (stderr, e, "\nUnable to coalesce",
! partition_to_var (map, x), " and ",
! partition_to_var (map, y));
! abort ();
}
conflict_graph_merge_regs (graph, x, y);
}
else
{
! print_exprs_edge (stderr, e, "\n Conflict ",
! partition_to_var (map, x),
! " and ", partition_to_var (map, y));
! abort ();
}
}
}
--- 750,764 ----
}
if (var_union (map, var, tmp) == NO_PARTITION)
{
! /* Unable to coalesce. */
! continue;
}
conflict_graph_merge_regs (graph, x, y);
}
else
{
! /* The variables conflict, cannot coalesce. */
! continue;
}
}
}
*************** rewrite_trees (var_map map, tree *values
*** 1826,1832 ****
for (i = 0; i < num_uses; i++)
{
use_p = USE_OP_PTR (uses, i);
! if (replace_variable (map, use_p, values))
changed = true;
}
--- 1914,1921 ----
for (i = 0; i < num_uses; i++)
{
use_p = USE_OP_PTR (uses, i);
! if (TREE_CODE (*use_p) == SSA_NAME
! && replace_variable (map, use_p, values))
changed = true;
}
*************** rewrite_trees (var_map map, tree *values
*** 1839,1847 ****
{
tree def = DEF_OP (defs, 0);
tree val;
! val = values[SSA_NAME_VERSION (def)];
! if (val)
! remove = 1;
}
if (!remove)
{
--- 1928,1940 ----
{
tree def = DEF_OP (defs, 0);
tree val;
!
! if (TREE_CODE (def) == SSA_NAME)
! {
! val = values[SSA_NAME_VERSION (def)];
! if (val)
! remove = 1;
! }
}
if (!remove)
{
*************** rewrite_trees (var_map map, tree *values
*** 1849,1855 ****
{
tree *def_p = DEF_OP_PTR (defs, i);
! if (replace_variable (map, def_p, NULL))
changed = true;
/* If both SSA_NAMEs coalesce to the same variable,
--- 1942,1949 ----
{
tree *def_p = DEF_OP_PTR (defs, i);
! if (TREE_CODE (*def_p) == SSA_NAME
! && replace_variable (map, def_p, NULL))
changed = true;
/* If both SSA_NAMEs coalesce to the same variable,
*************** rewrite_trees (var_map map, tree *values
*** 1872,1882 ****
bsi_next (&si);
}
! phi = phi_nodes (bb);
! if (phi)
! {
! for (e = bb->pred; e; e = e->pred_next)
! eliminate_phi (e, phi_arg_from_edge (phi, e), g);
}
}
--- 1966,1992 ----
bsi_next (&si);
}
! for (e = bb->pred; e; e = e->pred_next)
! if (e->flags & EDGE_ABNORMAL
! && e->dest != EXIT_BLOCK_PTR)
! break;
!
! if (e)
! {
! /* We have an abnormal predecessor. If any copies need to be
! emitted, we must create a temporary that will be assigned
! before the abnormal edge. */
! for (phi = phi_nodes (bb); phi; phi = TREE_CHAIN (phi))
! eliminate_abnormal_phi (phi, g);
! }
! else
! {
! phi = phi_nodes (bb);
! if (phi)
! {
! for (e = bb->pred; e; e = e->pred_next)
! eliminate_phi (e, phi_arg_from_edge (phi, e), g);
! }
}
}
Index: tree-phinodes.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-phinodes.c,v
retrieving revision 1.1.2.9
diff -c -3 -p -r1.1.2.9 tree-phinodes.c
*** tree-phinodes.c 13 Feb 2004 13:11:53 -0000 1.1.2.9
--- tree-phinodes.c 21 Apr 2004 20:47:27 -0000
*************** add_phi_arg (tree *phi, tree def, edge e
*** 356,369 ****
}
}
- /* Copy propagation needs to know what object occur in abnormal
- PHI nodes. This is a convenient place to record such information. */
- if (e->flags & EDGE_ABNORMAL)
- {
- SSA_NAME_OCCURS_IN_ABNORMAL_PHI (def) = 1;
- SSA_NAME_OCCURS_IN_ABNORMAL_PHI (PHI_RESULT (*phi)) = 1;
- }
-
PHI_ARG_DEF (*phi, i) = def;
PHI_ARG_EDGE (*phi, i) = e;
PHI_NUM_ARGS (*phi)++;
--- 356,361 ----
Index: tree-ssa-dom.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-ssa-dom.c,v
retrieving revision 1.1.2.158
diff -c -3 -p -r1.1.2.158 tree-ssa-dom.c
*** tree-ssa-dom.c 20 Apr 2004 14:22:30 -0000 1.1.2.158
--- tree-ssa-dom.c 21 Apr 2004 20:47:28 -0000
*************** simplify_rhs_and_lookup_avail_expr (stru
*** 1714,1721 ****
rhs_def_operand = TREE_OPERAND (TREE_OPERAND (rhs_def_stmt, 1), 0);
/* Verify that RHS_DEF_OPERAND is a suitable SSA variable. */
! if (TREE_CODE (rhs_def_operand) == SSA_NAME
! && ! SSA_NAME_OCCURS_IN_ABNORMAL_PHI (rhs_def_operand))
result = update_rhs_and_lookup_avail_expr (stmt,
rhs_def_operand,
&bd->avail_exprs,
--- 1714,1720 ----
rhs_def_operand = TREE_OPERAND (TREE_OPERAND (rhs_def_stmt, 1), 0);
/* Verify that RHS_DEF_OPERAND is a suitable SSA variable. */
! if (TREE_CODE (rhs_def_operand) == SSA_NAME)
result = update_rhs_and_lookup_avail_expr (stmt,
rhs_def_operand,
&bd->avail_exprs,
*************** simplify_rhs_and_lookup_avail_expr (stru
*** 1748,1754 ****
tree def_stmt_op1 = TREE_OPERAND (rhs_def_rhs, 1);
if (TREE_CODE (def_stmt_op0) == SSA_NAME
- && ! SSA_NAME_OCCURS_IN_ABNORMAL_PHI (def_stmt_op0)
&& is_gimple_min_invariant (def_stmt_op1))
{
tree outer_const = TREE_OPERAND (rhs, 1);
--- 1747,1752 ----
*************** eliminate_redundant_computations (struct
*** 2288,2294 ****
if (ann->makes_aliased_stores
|| ! def
|| TREE_CODE (def) != SSA_NAME
- || SSA_NAME_OCCURS_IN_ABNORMAL_PHI (def)
|| NUM_VDEFS (vdefs) != 0)
insert = false;
--- 2286,2291 ----
Index: tree-ssa.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-ssa.c,v
retrieving revision 1.1.4.220
diff -c -3 -p -r1.1.4.220 tree-ssa.c
*** tree-ssa.c 13 Apr 2004 22:33:33 -0000 1.1.4.220
--- tree-ssa.c 21 Apr 2004 20:47:28 -0000
*************** verify_def (basic_block bb, basic_block
*** 156,170 ****
DEF_BB is the block where SSA_NAME was found to be created.
! IDOM contains immediate dominator information for the flowgraph.
!
! CHECK_ABNORMAL is true if the caller wants to check whether this use
! is flowing through an abnormal edge (only used when checking PHI
! arguments). */
static bool
verify_use (basic_block bb, basic_block def_bb, tree ssa_name,
! tree stmt, bool check_abnormal)
{
bool err = false;
--- 156,166 ----
DEF_BB is the block where SSA_NAME was found to be created.
! IDOM contains immediate dominator information for the flowgraph. */
static bool
verify_use (basic_block bb, basic_block def_bb, tree ssa_name,
! tree stmt)
{
bool err = false;
*************** verify_use (basic_block bb, basic_block
*** 183,195 ****
err = true;
}
- if (check_abnormal
- && !SSA_NAME_OCCURS_IN_ABNORMAL_PHI (ssa_name))
- {
- error ("SSA_NAME_OCCURS_IN_ABNORMAL_PHI should be set");
- err = true;
- }
-
if (err)
{
fprintf (stderr, "for SSA_NAME: ");
--- 179,184 ----
*************** verify_phi_args (tree phi, basic_block b
*** 230,236 ****
if (TREE_CODE (op) == SSA_NAME)
err |= verify_use (e->src, definition_block[SSA_NAME_VERSION (op)], op,
! phi, e->flags & EDGE_ABNORMAL);
if (e->dest != bb)
{
--- 219,225 ----
if (TREE_CODE (op) == SSA_NAME)
err |= verify_use (e->src, definition_block[SSA_NAME_VERSION (op)], op,
! phi);
if (e->dest != bb)
{
*************** verify_ssa (void)
*** 400,406 ****
err = true;
}
err |= verify_use (bb, definition_block[SSA_NAME_VERSION (op)],
! op, stmt, false);
}
vdefs = VDEF_OPS (ann);
--- 389,395 ----
err = true;
}
err |= verify_use (bb, definition_block[SSA_NAME_VERSION (op)],
! op, stmt);
}
vdefs = VDEF_OPS (ann);
*************** verify_ssa (void)
*** 416,422 ****
err = true;
}
err |= verify_use (bb, definition_block[SSA_NAME_VERSION (op)],
! op, stmt, false);
}
uses = USE_OPS (ann);
--- 405,411 ----
err = true;
}
err |= verify_use (bb, definition_block[SSA_NAME_VERSION (op)],
! op, stmt);
}
uses = USE_OPS (ann);
*************** verify_ssa (void)
*** 432,438 ****
err = true;
}
err |= verify_use (bb, definition_block[SSA_NAME_VERSION (op)],
! op, stmt, false);
}
}
}
--- 421,427 ----
err = true;
}
err |= verify_use (bb, definition_block[SSA_NAME_VERSION (op)],
! op, stmt);
}
}
}
*************** replace_immediate_uses (tree var, tree r
*** 713,724 ****
{
for (j = 0; j < PHI_NUM_ARGS (stmt); j++)
if (PHI_ARG_DEF (stmt, j) == var)
! {
! PHI_ARG_DEF (stmt, j) = repl;
! if (TREE_CODE (repl) == SSA_NAME
! && PHI_ARG_EDGE (stmt, j)->flags & EDGE_ABNORMAL)
! SSA_NAME_OCCURS_IN_ABNORMAL_PHI (repl) = 1;
! }
continue;
}
--- 702,708 ----
{
for (j = 0; j < PHI_NUM_ARGS (stmt); j++)
if (PHI_ARG_DEF (stmt, j) == var)
! PHI_ARG_DEF (stmt, j) = repl;
continue;
}
*************** kill_redundant_phi_nodes (void)
*** 895,902 ****
phi node or the argument is associated with an abnormal
edge, then we need to recursively start the forward
dataflow starting with PHI. */
! if (TREE_CODE (stmt) != PHI_NODE
! || SSA_NAME_OCCURS_IN_ABNORMAL_PHI (t))
{
eq_to[aver] = t;
raise_value (phi, t, eq_to);
--- 879,885 ----
phi node or the argument is associated with an abnormal
edge, then we need to recursively start the forward
dataflow starting with PHI. */
! if (TREE_CODE (stmt) != PHI_NODE)
{
eq_to[aver] = t;
raise_value (phi, t, eq_to);
Index: tree.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree.h,v
retrieving revision 1.342.2.184
diff -c -3 -p -r1.342.2.184 tree.h
*** tree.h 15 Apr 2004 19:55:18 -0000 1.342.2.184
--- tree.h 21 Apr 2004 20:47:28 -0000
*************** struct tree_exp GTY(())
*** 1159,1170 ****
tree SSA, version numbers are not per variable and may be recycled. */
#define SSA_NAME_VERSION(NODE) SSA_NAME_CHECK (NODE)->ssa_name.version
- /* Nonzero if this SSA name occurs in an abnormal PHI. SSA_NAMES are
- never output, so we can safely use the ASM_WRITTEN_FLAG for this
- status bit. */
- #define SSA_NAME_OCCURS_IN_ABNORMAL_PHI(NODE) \
- SSA_NAME_CHECK (NODE)->common.asm_written_flag
-
/* Nonzero if this SSA_NAME expression is currently on the freelist of
SSA_NAMES. Using NOTHROW_FLAG seems reasonably safe since throwing
has no meaning for an SSA_NAME. */
--- 1159,1164 ----