diff options
author | Dehao Chen <dehao@google.com> | 2014-05-16 23:16:13 +0000 |
---|---|---|
committer | Dehao Chen <dehao@gcc.gnu.org> | 2014-05-16 23:16:13 +0000 |
commit | 2f6eed01c3108567757447e1663fa385977960e7 (patch) | |
tree | bade7ce8e39d8b581d19f011575ebb6e0a4f40d3 /gcc/tree-cfg.c | |
parent | b200de021c2c1bb5b3794e793831e2211466620c (diff) | |
download | gcc-2f6eed01c3108567757447e1663fa385977960e7.zip gcc-2f6eed01c3108567757447e1663fa385977960e7.tar.gz gcc-2f6eed01c3108567757447e1663fa385977960e7.tar.bz2 |
tree-cfg.c (gimple_merge_blocks): Updates bb count with max count.
2014-05-16 Dehao Chen <dehao@google.com>
* tree-cfg.c (gimple_merge_blocks): Updates bb count with max count.
From-SVN: r210538
Diffstat (limited to 'gcc/tree-cfg.c')
-rw-r--r-- | gcc/tree-cfg.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c index 9be04fe..25e65e0 100644 --- a/gcc/tree-cfg.c +++ b/gcc/tree-cfg.c @@ -1877,6 +1877,12 @@ 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); + /* Merge the sequences. */ last = gsi_last_bb (a); gsi_insert_seq_after (&last, bb_seq (b), GSI_NEW_STMT); |