summaryrefslogtreecommitdiff
path: root/gcc/gimple-streamer-in.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/gimple-streamer-in.c')
-rw-r--r--gcc/gimple-streamer-in.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/gimple-streamer-in.c b/gcc/gimple-streamer-in.c
index 0dabe1adcf6..56f748a23ae 100644
--- a/gcc/gimple-streamer-in.c
+++ b/gcc/gimple-streamer-in.c
@@ -264,8 +264,11 @@ input_bb (struct lto_input_block *ib, enum LTO_tags tag,
index = streamer_read_uhwi (ib);
bb = BASIC_BLOCK_FOR_FN (fn, index);
- bb->count = profile_count::stream_in (ib).apply_scale
- (count_materialization_scale, REG_BR_PROB_BASE);
+ bb->count = profile_count::stream_in (ib);
+ if (count_materialization_scale != REG_BR_PROB_BASE
+ && bb->count.ipa ().nonzero_p ())
+ bb->count
+ = bb->count.apply_scale (count_materialization_scale, REG_BR_PROB_BASE);
bb->flags = streamer_read_hwi (ib);
/* LTO_bb1 has statements. LTO_bb0 does not. */