Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(63)

Issue 5533075: fix ICE caused by profile mismatch

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 3 months ago by xur
Modified:
12 years, 3 months ago
Reviewers:
davidxl
CC:
gcc-patches_gcc.gnu.org
Base URL:
svn+ssh://gcc.gnu.org/svn/gcc/branches/google/main/
Visibility:
Public.

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+12 lines, -9 lines) Patch
M gcc/profile.c View 2 chunks +12 lines, -9 lines 0 comments Download

Messages

Total messages: 2
xur
This patch fixes the ICE when building the histrogram for value profile. It's casued by ...
12 years, 3 months ago (2012-01-11 22:55:50 UTC) #1
davidxl
12 years, 3 months ago (2012-01-12 21:47:05 UTC) #2
ok for google branches.

David

On Wed, Jan 11, 2012 at 2:55 PM, Rong Xu <xur@google.com> wrote:
> This patch fixes the ICE when building the histrogram for
> value profile. It's casued by profile mismatch.
>
> Tested with SPEC2000 INT.
>
> This is for google branches.
>
> 2012-01-11   Rong Xu  <xur@google.com>
>
>        * gcc/profile.c (compute_value_histograms): ignore the
>        histrogram when the counters not found in gcda file.
>
> Index: gcc/profile.c
> ===================================================================
> --- gcc/profile.c       (revision 183109)
> +++ gcc/profile.c       (working copy)
> @@ -790,10 +790,14 @@
>   gcov_type *histogram_counts[GCOV_N_VALUE_COUNTERS];
>   gcov_type *act_count[GCOV_N_VALUE_COUNTERS];
>   gcov_type *aact_count;
> -  bool warned = false;
> +  bool warned[GCOV_N_VALUE_COUNTERS];
> +  static const char *const ctr_names[] = GCOV_COUNTER_NAMES;
>
>   for (t = 0; t < GCOV_N_VALUE_COUNTERS; t++)
> -    n_histogram_counters[t] = 0;
> +    {
> +      n_histogram_counters[t] = 0;
> +      warned[t] = 0;
> +    }
>
>   for (i = 0; i < VEC_length (histogram_value, values); i++)
>     {
> @@ -829,18 +833,17 @@
>       t = (int) hist->type;
>
>       aact_count = act_count[t];
> +      /* If the counter cannot be found in gcda file, skip this
> +         histogram and give a warning.  */
>       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.",
> +          if (!warned[t] && flag_opt_info >= OPT_INFO_MIN)
> +            warning (0, "cannot find %s counters in function %s.",
> +                     ctr_names[COUNTER_FOR_HIST_TYPE(t)],
>                      IDENTIFIER_POINTER (
>                        DECL_ASSEMBLER_NAME (current_function_decl)));
>           hist->n_counters = 0;
> -          warned = true;
> +          warned[t] = true;
>           continue;
>         }
>       act_count[t] += hist->n_counters;
>
> --
> This patch is available for review at http://codereview.appspot.com/5533075
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b