aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorDavid Li <davidxl@google.com>2011-08-04 06:22:15 +0000
committerXinliang David Li <davidxl@gcc.gnu.org>2011-08-04 06:22:15 +0000
commit63a730710434c6606c81ee5bf56f26818c0aef54 (patch)
tree573c37679ccb755434de48b3b6bb7f22613ba32b /gcc
parent9003789808b2d385b2c1735d1aa7df0c8eee445d (diff)
downloadgcc-63a730710434c6606c81ee5bf56f26818c0aef54.zip
gcc-63a730710434c6606c81ee5bf56f26818c0aef54.tar.gz
gcc-63a730710434c6606c81ee5bf56f26818c0aef54.tar.bz2
Fix a bug in cfg fixup
From-SVN: r177313
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/tree-optimize.c4
2 files changed, 9 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 1f84610..58daaa3 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,10 @@
2011-08-03 David Li <davidxl@google.com>
+ * tree-optimize.c (execute_fixup_cfg): Fix up entry
+ outgoing edge counts after inlining.
+
+2011-08-03 David Li <davidxl@google.com>
+
* profile.c (compute_branch_probabilities): Compute
function frequency after profile annotation.
diff --git a/gcc/tree-optimize.c b/gcc/tree-optimize.c
index 411886ca..5479d90 100644
--- a/gcc/tree-optimize.c
+++ b/gcc/tree-optimize.c
@@ -256,6 +256,10 @@ execute_fixup_cfg (void)
EXIT_BLOCK_PTR->count = (EXIT_BLOCK_PTR->count * count_scale
+ REG_BR_PROB_BASE / 2) / REG_BR_PROB_BASE;
+ FOR_EACH_EDGE (e, ei, ENTRY_BLOCK_PTR->succs)
+ e->count = (e->count * count_scale
+ + REG_BR_PROB_BASE / 2) / REG_BR_PROB_BASE;
+
FOR_EACH_BB (bb)
{
bb->count = (bb->count * count_scale