2012-12-13 Teresa Johnson <[email protected]>
PR gcov-profile/55674
* lto-cgraph.c (merge_profile_summaries): Set min correctly the
first time we merge into a histogram entry.
Index: lto-cgraph.c
===================================================================
--- lto-cgraph.c (revision 194496)
+++ lto-cgraph.c (working copy)
@@ -1368,7 +1368,9 @@ merge_profile_summaries (struct lto_file_decl_data
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
--
This patch is available for review at http://codereview.appspot.com/6946049