aboutsummaryrefslogtreecommitdiff
path: root/gcc/lto-cgraph.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/lto-cgraph.c')
-rw-r--r--gcc/lto-cgraph.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/lto-cgraph.c b/gcc/lto-cgraph.c
index 85b1ea4a5f3..73a58f03206 100644
--- a/gcc/lto-cgraph.c
+++ b/gcc/lto-cgraph.c
@@ -1368,7 +1368,9 @@ merge_profile_summaries (struct lto_file_decl_data **file_data_vec)
so we need to account for a non-zero histogram entry at new_ix. */
unsigned new_ix = gcov_histo_index (scaled_min);
lto_gcov_summary.histogram[new_ix].min_value
- = MIN (lto_gcov_summary.histogram[new_ix].min_value, scaled_min);
+ = (lto_gcov_summary.histogram[new_ix].num_counters
+ ? MIN (lto_gcov_summary.histogram[new_ix].min_value, scaled_min)
+ : scaled_min);
/* Some of the scaled counter values would ostensibly need to be placed
into different (larger) histogram buckets, but we keep things simple
here and place the scaled cumulative counter value in the bucket