From: Dehao Chen Date: Fri, 16 May 2014 23:16:13 +0000 (+0000) Subject: tree-cfg.c (gimple_merge_blocks): Updates bb count with max count. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2f6eed01c3108567757447e1663fa385977960e7;p=gcc.git tree-cfg.c (gimple_merge_blocks): Updates bb count with max count. 2014-05-16 Dehao Chen * tree-cfg.c (gimple_merge_blocks): Updates bb count with max count. From-SVN: r210538 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e73879ceddc..5b516955a40 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2014-05-16 Dehao Chen + + * tree-cfg.c (gimple_merge_blocks): Updates bb count with max count. + 2014-05-16 Oleg Endo PR target/54089 diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c index 9be04fe81b5..25e65e0ea38 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);