summaryrefslogtreecommitdiff
path: root/gcc/gimple-streamer-in.c
diff options
context:
space:
mode:
authortejohnson <tejohnson@138bc75d-0d04-0410-961f-82ee72b054a4>2013-04-29 13:22:46 +0000
committertejohnson <tejohnson@138bc75d-0d04-0410-961f-82ee72b054a4>2013-04-29 13:22:46 +0000
commite2bc4ec8d5c6cfcf1caacbfab229a22728a11d75 (patch)
tree9daf54908866e15052bfcfc011bc4753b4b363fb /gcc/gimple-streamer-in.c
parentc48f77d534fed8f4995de260aaabc84f0790012d (diff)
downloadgcc-e2bc4ec8d5c6cfcf1caacbfab229a22728a11d75.tar.gz
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 <tejohnson@google.com> 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@198416 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gimple-streamer-in.c')
-rw-r--r--gcc/gimple-streamer-in.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/gimple-streamer-in.c b/gcc/gimple-streamer-in.c
index a27f0d6d62f..03fbe91bbe2 100644
--- a/gcc/gimple-streamer-in.c
+++ b/gcc/gimple-streamer-in.c
@@ -329,8 +329,8 @@ input_bb (struct lto_input_block *ib, enum LTO_tags tag,
index = streamer_read_uhwi (ib);
bb = BASIC_BLOCK_FOR_FUNCTION (fn, index);
- bb->count = apply_probability (streamer_read_gcov_count (ib),
- count_materialization_scale);
+ bb->count = apply_scale (streamer_read_gcov_count (ib),
+ count_materialization_scale);
bb->frequency = streamer_read_hwi (ib);
bb->flags = streamer_read_hwi (ib);