This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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.

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]