summaryrefslogtreecommitdiff
path: root/gcc/tree-mudflap.c
diff options
context:
space:
mode:
authorFrank Ch. Eigler <fche@redhat.com>2004-09-23 15:47:59 +0000
committerFrank Ch. Eigler <fche@gcc.gnu.org>2004-09-23 15:47:59 +0000
commitdf485d8007f540528501f9286531088ae5044420 (patch)
tree8cb2d5d482a0f8a0cfd2788c5789fd9692386513 /gcc/tree-mudflap.c
parent7ccf35ed170c496d99d670986e96e7c1d779cee3 (diff)
downloadgcc-df485d8007f540528501f9286531088ae5044420.tar.gz
re PR tree-optimization/17533 (cc1plus crashes on libmudflap test case, verify_dominators())
2004-09-23 Frank Ch. Eigler <fche@redhat.com> PR tree-optimization/17533 * dominance.c (verify_dominators): Tolerate even more incorrect dominance data during error message printing. * tree-mudflap.c (mf_build_check_statement_for): Build basic blocks and edges more correctly. From-SVN: r87954
Diffstat (limited to 'gcc/tree-mudflap.c')
-rw-r--r--gcc/tree-mudflap.c25
1 files changed, 21 insertions, 4 deletions
diff --git a/gcc/tree-mudflap.c b/gcc/tree-mudflap.c
index d5e278d6b21..138dda88007 100644
--- a/gcc/tree-mudflap.c
+++ b/gcc/tree-mudflap.c
@@ -508,25 +508,42 @@ mf_build_check_statement_for (tree addr, tree size,
bsi_prev (&bsi);
if (! bsi_end_p (bsi))
{
+ /* We're processing a statement in the middle of the block, so
+ we need to split the block. This creates a new block and a new
+ fallthrough edge. */
e = split_block (cond_bb, bsi_stmt (bsi));
cond_bb = e->src;
join_bb = e->dest;
}
else
{
+ /* We're processing the first statement in the block, so we need
+ to split the incoming edge. This also creates a new block
+ and a new fallthrough edge. */
join_bb = cond_bb;
- cond_bb = create_empty_bb (join_bb->prev_bb);
- e = make_edge (cond_bb, join_bb, 0);
+ cond_bb = split_edge (find_edge (join_bb->prev_bb, join_bb));
}
- e->flags = EDGE_FALSE_VALUE;
+
+ /* A recap at this point: join_bb is the basic block at whose head
+ is the gimple statement for which this check expression is being
+ built. cond_bb is the new synthetic basic block which will
+ contain the cache-lookup code, and a conditional that jumps to
+ the cache-miss code or, much more likely, over to join_bb. */
+
+ /* Create the bb that contains the cache-miss fallback block (mf_check). */
then_bb = create_empty_bb (cond_bb);
make_edge (cond_bb, then_bb, EDGE_TRUE_VALUE);
- make_edge (then_bb, join_bb, EDGE_FALLTHRU);
+ make_single_succ_edge (then_bb, join_bb, EDGE_FALLTHRU);
/* We expect that the conditional jump we will construct will not
be taken very often as it basically is an exception condition. */
predict_edge_def (then_bb->pred, PRED_MUDFLAP, NOT_TAKEN);
+ /* Mark the pseudo-fallthrough edge from cond_bb to join_bb. */
+ e = find_edge (cond_bb, join_bb);
+ e->flags = EDGE_FALSE_VALUE;
+ predict_edge_def (e, PRED_MUDFLAP, TAKEN);
+
/* Update dominance info. Note that bb_join's data was
updated by split_block. */
if (dom_computed[CDI_DOMINATORS] >= DOM_CONS_OK)