diff options
author | xur <xur@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-03-08 19:18:54 +0000 |
---|---|---|
committer | xur <xur@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-03-08 19:18:54 +0000 |
commit | 671610d36f9a3f0b375c9854667b1fbdac6329cc (patch) | |
tree | e682300ad25817b6b87d1330dcd3c987e7736b59 | |
parent | deaf0485e9fa5a756784cff547368f34ecf1d9da (diff) |
2012-03-08 Rong Xu <xur@google.com>
* gcc/tree-inline.c (copy_cfg_body): fix the bug in r184378.
Google ref b/6105259.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/google/gcc-4_6@185108 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog.google-4_6 | 5 | ||||
-rw-r--r-- | gcc/tree-inline.c | 7 |
2 files changed, 8 insertions, 4 deletions
diff --git a/gcc/ChangeLog.google-4_6 b/gcc/ChangeLog.google-4_6 index 8c01ceb4cc3..1ce90cdb3ad 100644 --- a/gcc/ChangeLog.google-4_6 +++ b/gcc/ChangeLog.google-4_6 @@ -1,3 +1,8 @@ +2012-03-08 Rong Xu <xur@google.com> + + * gcc/tree-inline.c (copy_cfg_body): fix the bug in r184378. + Google ref b/6105259. + 2012-03-01 Jing Yu <jingyu@google.com> Revert r184493 (init/fini backport patch set) because of diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c index e5177e9d1cc..0437338afc9 100644 --- a/gcc/tree-inline.c +++ b/gcc/tree-inline.c @@ -2210,7 +2210,7 @@ copy_cfg_body (copy_body_data * id, gcov_type count, int frequency_scale, struct cgraph_node *node = cgraph_node (callee_fndecl); double f_max; gcov_type max_count_scale; - gcov_type max_src_bb_cnt; + gcov_type max_src_bb_cnt = 0; gcov_type max_value = ((gcov_type) 1 << ((sizeof(gcov_type) * 8) - 1)); max_value = ~max_value; count_scale = (REG_BR_PROB_BASE * (double)count @@ -2220,14 +2220,13 @@ copy_cfg_body (copy_body_data * id, gcov_type count, int frequency_scale, This can happen for comdat functions where the counters are split. It's more likely for recursive inlines. */ gcc_assert (node); - max_src_bb_cnt = node->max_bb_count; /* Find the maximum count value to that will be copied. */ FOR_EACH_BB_FN (bb, cfun_to_copy) if (!blocks_to_copy || bitmap_bit_p (blocks_to_copy, bb->index)) { - if (bb->count > node->max_bb_count) - max_src_bb_cnt = node->max_bb_count; + if (bb->count > max_src_bb_cnt) + max_src_bb_cnt = bb->count; } f_max = (double) max_value * REG_BR_PROB_BASE / max_src_bb_cnt - 1; |