aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-cfg.c
diff options
context:
space:
mode:
authorDehao Chen <dehao@google.com>2014-06-03 21:36:05 +0000
committerDehao Chen <dehao@gcc.gnu.org>2014-06-03 21:36:05 +0000
commit47e78f984ef151c621587a4dcdebc48dd577a36a (patch)
tree830ac6e9ad7a9571a908b35acefb2b113b8183f3 /gcc/tree-cfg.c
parenteb7404d46ae0ac7ec733e7b3850a00f11df2d4b7 (diff)
downloadgcc-47e78f984ef151c621587a4dcdebc48dd577a36a.zip
gcc-47e78f984ef151c621587a4dcdebc48dd577a36a.tar.gz
gcc-47e78f984ef151c621587a4dcdebc48dd577a36a.tar.bz2
tree-cfg.c (gimple_merge_blocks): Only reset count when BBs are in the same loop.
2014-06-03 Dehao Chen <dehao@google.com> * tree-cfg.c (gimple_merge_blocks): Only reset count when BBs are in the same loop. * gcc.dg/tree-prof/merge_block.c: New test. From-SVN: r211202
Diffstat (limited to 'gcc/tree-cfg.c')
-rw-r--r--gcc/tree-cfg.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c
index 126a1a9..acf08fc 100644
--- a/gcc/tree-cfg.c
+++ b/gcc/tree-cfg.c
@@ -1880,8 +1880,11 @@ gimple_merge_blocks (basic_block a, basic_block b)
/* When merging two BBs, if their counts are different, the larger count
is selected as the new bb count. This is to handle inconsistent
profiles. */
- a->count = MAX (a->count, b->count);
- a->frequency = MAX (a->frequency, b->frequency);
+ if (a->loop_father == b->loop_father)
+ {
+ a->count = MAX (a->count, b->count);
+ a->frequency = MAX (a->frequency, b->frequency);
+ }
/* Merge the sequences. */
last = gsi_last_bb (a);