cfghooks.c (make_forwarder_block): Decrement count on fallthru edge when redirecting...
authorPat Haugen <pthaugen@us.ibm.com>
Wed, 23 Jun 2004 04:09:46 +0000 (04:09 +0000)
committerJeff Law <law@gcc.gnu.org>
Wed, 23 Jun 2004 04:09:46 +0000 (22:09 -0600)
       * cfghooks.c (make_forwarder_block): Decrement count on fallthru edge
        when redirecting back edges.

        * cfghooks.c (split_block): Call make_single_succ_edge so that edge
        count/probability are set correctly.

From-SVN: r83537

gcc/ChangeLog
gcc/cfghooks.c

index ecd0f068d3dba823657b3282d0f69dde3ed5fee7..70fe4eed2ba65346fdf1066bcda5c0c913e01a4c 100644 (file)
@@ -1,3 +1,11 @@
+2004-06-22  Pat Haugen  <pthaugen@us.ibm.com>
+
+       * cfghooks.c (make_forwarder_block): Decrement count on fallthru edge
+       when redirecting back edges.
+
+       * cfghooks.c (split_block): Call make_single_succ_edge so that edge
+       count/probability are set correctly.
+
 2004-06-22  Richard Henderson  <rth@redhat.com>
 
        * c-typeck.c (emit_side_effect_warnings): Ignore error marks.
index 29f5dfd1695864f23dc04a263df799640ca77a54..bd67a21dc93d641cac1715ed706f669d2cc77215 100644 (file)
@@ -321,7 +321,7 @@ split_block (basic_block bb, void *i)
       set_immediate_dominator (CDI_DOMINATORS, new_bb, bb);
     }
 
-  return make_edge (bb, new_bb, EDGE_FALLTHRU);
+  return make_single_succ_edge (bb, new_bb, EDGE_FALLTHRU);
 }
 
 /* Splits block BB just after labels.  The newly created edge is returned.  */
@@ -566,6 +566,9 @@ make_forwarder_block (basic_block bb, bool (*redirect_edge_p) (edge),
        dummy->frequency = 0;
       if (dummy->count < 0)
        dummy->count = 0;
+      fallthru->count -= e->count;
+      if (fallthru->count < 0)
+       fallthru->count = 0;
 
       jump = redirect_edge_and_branch_force (e, bb);
       if (jump)