Hi,
as noticed by Martin we ICE when value profiles get mismatch only in some 
values.
This seems to be happening on Firefox 8 for weird reason where we optimize out
&sym == &sym2 comparsion at profile-use but not at profile-generate time.  We 
are
still looking into that problem, but this patch fixes the obvoius ICE.

Bootstrapped/regtested x86_64-linux, comitted.
Honza

Index: ChangeLog
===================================================================
--- ChangeLog   (revision 201332)
+++ ChangeLog   (working copy)
@@ -1,3 +1,9 @@
+2013-07-30  Jan Hubicka  <j...@suse.cz>
+           Martin Liska  <marxin.li...@gmail.com>
+
+       * profile.c (compute_value_histograms): Do not ICE when
+       there is mismatch only on some counters.
+
 2013-07-30  Zhenqiang Chen  <zhenqiang.c...@linaro.org>
 
        PR rtl-optimization/57637
Index: profile.c
===================================================================
--- profile.c   (revision 201250)
+++ profile.c   (working copy)
@@ -885,12 +885,16 @@ compute_value_histograms (histogram_valu
       t = (int) hist->type;
 
       aact_count = act_count[t];
-      act_count[t] += hist->n_counters;
+      if (act_count[t])
+        act_count[t] += hist->n_counters;
 
       gimple_add_histogram_value (cfun, stmt, hist);
       hist->hvalue.counters =  XNEWVEC (gcov_type, hist->n_counters);
       for (j = 0; j < hist->n_counters; j++)
-       hist->hvalue.counters[j] = aact_count[j];
+        if (aact_count[t])
+         hist->hvalue.counters[j] = aact_count[j];
+       else
+         hist->hvalue.counters[j] = 0;
     }
 
   for (t = 0; t < GCOV_N_VALUE_COUNTERS; t++)

Reply via email to