OSDN Git Service

2004-09-23 Frank Ch. Eigler <fche@redhat.com>
authorfche <fche@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 23 Sep 2004 15:47:59 +0000 (15:47 +0000)
committerfche <fche@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 23 Sep 2004 15:47:59 +0000 (15:47 +0000)
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@87954 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/dominance.c
gcc/tree-mudflap.c

index 65f8c94..93ad667 100644 (file)
@@ -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):
 2004-09-23  Dorit Naishlos <dorit@il.ibm.com>
 
         * tree.def (ALIGN_INDIRECT_REF, MISALIGNED_INDIRECT_REF):
index ef40b54..bbb0b21 100644 (file)
@@ -829,16 +829,17 @@ verify_dominators (enum cdi_direction dir)
   FOR_EACH_BB (bb)
     {
       basic_block dom_bb;
   FOR_EACH_BB (bb)
     {
       basic_block dom_bb;
+      basic_block imm_bb;
 
       dom_bb = recount_dominator (dir, 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",
          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;
        }
     }
          err = 1;
        }
     }
index d5e278d..138dda8 100644 (file)
@@ -508,25 +508,42 @@ mf_build_check_statement_for (tree addr, tree size,
   bsi_prev (&bsi);
   if (! bsi_end_p (bsi))
     {
   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
     {
       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;
       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);
   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);
 
 
   /* 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)
   /* Update dominance info.  Note that bb_join's data was
      updated by split_block.  */
   if (dom_computed[CDI_DOMINATORS] >= DOM_CONS_OK)