Fix LTO binary size increases (PR gcov-profile/55674) (issue6946049)

Submitted by Teresa Johnson on Dec. 14, 2012, 6:42 a.m.

Details

Message ID 20121214064242.3ECDA615D9@tjsboxrox.mtv.corp.google.com
State New
Headers show

Commit Message

Teresa Johnson Dec. 14, 2012, 6:42 a.m.
2012-12-13  Teresa Johnson  <tejohnson@google.com>

        PR gcov-profile/55674
	* lto-cgraph.c (merge_profile_summaries): Set min correctly the
        first time we merge into a histogram entry.


--
This patch is available for review at http://codereview.appspot.com/6946049

Comments

Jan Hubicka Dec. 14, 2012, 7:03 a.m.
> 2012-12-13  Teresa Johnson  <tejohnson@google.com>
> 
>         PR gcov-profile/55674
> 	* lto-cgraph.c (merge_profile_summaries): Set min correctly the
>         first time we merge into a histogram entry.

OK,
thanks!
Honza

Patch hide | download patch | download mbox

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