aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-inline.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree-inline.c')
-rw-r--r--gcc/tree-inline.c7
1 files changed, 3 insertions, 4 deletions
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;