From f41f80f90846d26a89ed5a6440bc283b745235ac Mon Sep 17 00:00:00 2001 From: Teresa Johnson Date: Mon, 29 Apr 2013 13:22:46 +0000 Subject: This patch fixes PR bootstrap/57077. This patch fixes PR bootstrap/57077. Certain new uses of apply_probability are actually scaling the counts up, and the scale factor should not be treated as a probability as the value may exceed REG_BR_PROB_BASE. One example (from the PR) is when scaling counts up in LTO when merging profiles. Another example I found when preparing the patch to use the rounding divide in more places is when inlining COMDAT functions. Add new helper function apply_scale that does the scaling without the probability range check. I audited the new uses of apply_probability and changed the calls as appropriate. 2013-04-29 Teresa Johnson PR bootstrap/57077 * basic-block.h (apply_scale): New function. (apply_probability): Use apply_scale. * gimple-streamer-in.c (input_bb): Ditto. * lto-streamer-in.c (input_cfg): Ditto. * lto-cgraph.c (merge_profile_summaries): Ditto. * tree-optimize.c (execute_fixup_cfg): Ditto. * tree-inline.c (copy_bb): Update comment to use apply_scale. (copy_edges_for_bb): Ditto. (copy_cfg_body): Ditto. From-SVN: r198416 --- gcc/lto-streamer-in.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gcc/lto-streamer-in.c') diff --git a/gcc/lto-streamer-in.c b/gcc/lto-streamer-in.c index f5789c0..87158bf 100644 --- a/gcc/lto-streamer-in.c +++ b/gcc/lto-streamer-in.c @@ -635,8 +635,8 @@ input_cfg (struct lto_input_block *ib, struct function *fn, dest_index = streamer_read_uhwi (ib); probability = (int) streamer_read_hwi (ib); - count = apply_probability ((gcov_type) streamer_read_gcov_count (ib), - count_materialization_scale); + count = apply_scale ((gcov_type) streamer_read_gcov_count (ib), + count_materialization_scale); edge_flags = streamer_read_uhwi (ib); dest = BASIC_BLOCK_FOR_FUNCTION (fn, dest_index); -- cgit v1.1