aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRong Xu <xur@google.com>2012-01-11 00:26:27 +0000
committerRong Xu <xur@google.com>2012-01-11 00:26:27 +0000
commit8402887a489e6662ffbacf2886cf41f4aa9c9e27 (patch)
tree27a45870c4aa60a8f17256a8bc093ac327c4c7bf
parent3a64be1ca48f200c77a62e95ff2f4ed8860eff81 (diff)
2012-01-10 Rong Xu <xur@google.com>
* gcc/profile.c (compute_value_histograms): handle the case when INDIR_CALL counters not available in gcda files. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/google/gcc-4_6@183086 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog.google-4_68
-rw-r--r--gcc/profile.c15
2 files changed, 23 insertions, 0 deletions
diff --git a/gcc/ChangeLog.google-4_6 b/gcc/ChangeLog.google-4_6
index 8f0af26bb5b..20bc43315c5 100644
--- a/gcc/ChangeLog.google-4_6
+++ b/gcc/ChangeLog.google-4_6
@@ -1,3 +1,11 @@
+2012-01-10 Rong Xu <xur@google.com>
+
+ Backport r183081 from google/main
+
+ * gcc/profile.c (compute_value_histograms): handle the
+ case when INDIR_CALL counters not available in gcda files.
+
+
2012-01-09 Dehao Chen <dehao@google.com>
* ipa-inline.c (cgraph_node_opt_info): Print profile info if available
diff --git a/gcc/profile.c b/gcc/profile.c
index b16c9a26710..10b75e37220 100644
--- a/gcc/profile.c
+++ b/gcc/profile.c
@@ -790,6 +790,7 @@ compute_value_histograms (histogram_values values, unsigned cfg_checksum,
gcov_type *histogram_counts[GCOV_N_VALUE_COUNTERS];
gcov_type *act_count[GCOV_N_VALUE_COUNTERS];
gcov_type *aact_count;
+ bool warned = false;
for (t = 0; t < GCOV_N_VALUE_COUNTERS; t++)
n_histogram_counters[t] = 0;
@@ -828,6 +829,20 @@ compute_value_histograms (histogram_values values, unsigned cfg_checksum,
t = (int) hist->type;
aact_count = act_count[t];
+ if (aact_count == 0)
+ {
+ /* this can only happen when FDO uses LIPO profiles where
+ we have HIST_TYPE_INDIR_CALL_TOPN counters in gcda
+ files. */
+ gcc_assert (hist->type == HIST_TYPE_INDIR_CALL);
+ if (!warned && flag_opt_info >= OPT_INFO_MIN)
+ warning (0, "cannot find INDIR_CALL counters in func %s.",
+ IDENTIFIER_POINTER (
+ DECL_ASSEMBLER_NAME (current_function_decl)));
+ hist->n_counters = 0;
+ warned = true;
+ continue;
+ }
act_count[t] += hist->n_counters;
gimple_add_histogram_value (cfun, stmt, hist);