summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/dominance.c11
-rw-r--r--gcc/tree-mudflap.c25
3 files changed, 35 insertions, 9 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 65f8c94af6c..93ad667c95e 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+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.
+
2004-09-23 Dorit Naishlos <dorit@il.ibm.com>
* tree.def (ALIGN_INDIRECT_REF, MISALIGNED_INDIRECT_REF):
diff --git a/gcc/dominance.c b/gcc/dominance.c
index ef40b545e8c..bbb0b21484b 100644
--- a/gcc/dominance.c
+++ b/gcc/dominance.c
@@ -829,16 +829,17 @@ verify_dominators (enum cdi_direction dir)
FOR_EACH_BB (bb)
{
basic_block dom_bb;
+ basic_block imm_bb;
dom_bb = recount_dominator (dir, bb);
- if (dom_bb != get_immediate_dominator (dir, bb))
+ imm_bb = get_immediate_dominator (dir, bb);
+ if (dom_bb != imm_bb)
{
- if (dom_bb == NULL)
- error ("dominator of %d should be (unknown), not %d",
- bb->index, get_immediate_dominator(dir, bb)->index);
+ if ((dom_bb == NULL) || (imm_bb == NULL))
+ error ("dominator of %d status unknown", bb->index);
else
error ("dominator of %d should be %d, not %d",
- bb->index, dom_bb->index, get_immediate_dominator(dir, bb)->index);
+ bb->index, dom_bb->index, imm_bb->index);
err = 1;
}
}
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)