aboutsummaryrefslogtreecommitdiff
path: root/gcc/cfghooks.c
diff options
context:
space:
mode:
authorPat Haugen <pthaugen@us.ibm.com>2004-06-23 04:09:46 +0000
committerJeff Law <law@gcc.gnu.org>2004-06-22 22:09:46 -0600
commit649b2789d1a5e18be4bc10e1c35d81b405cf2b05 (patch)
tree0d932e098851549e39ec9a89ee17784215970080 /gcc/cfghooks.c
parent1cc3d0854a26a83a3ac513e9d034fbba17a2ca94 (diff)
downloadgcc-649b2789d1a5e18be4bc10e1c35d81b405cf2b05.zip
gcc-649b2789d1a5e18be4bc10e1c35d81b405cf2b05.tar.gz
gcc-649b2789d1a5e18be4bc10e1c35d81b405cf2b05.tar.bz2
cfghooks.c (make_forwarder_block): Decrement count on fallthru edge when redirecting back edges.
* 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
Diffstat (limited to 'gcc/cfghooks.c')
-rw-r--r--gcc/cfghooks.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/cfghooks.c b/gcc/cfghooks.c
index 29f5dfd..bd67a21 100644
--- a/gcc/cfghooks.c
+++ b/gcc/cfghooks.c
@@ -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)