aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2013-07-30 14:00:42 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2013-07-30 12:00:42 +0000
commit605e86fa3f9faa7f244ead20033aa1263d635c21 (patch)
tree9be479df66543cd0fbfc4055e4671cf88c8b127d /gcc
parent60de1c7df5486e81b52c9db5003abba08af7b3f9 (diff)
downloadgcc-605e86fa3f9faa7f244ead20033aa1263d635c21.zip
gcc-605e86fa3f9faa7f244ead20033aa1263d635c21.tar.gz
gcc-605e86fa3f9faa7f244ead20033aa1263d635c21.tar.bz2
profile.c (compute_value_histograms): Do not ICE when there is mismatch only on some counters.
* profile.c (compute_value_histograms): Do not ICE when there is mismatch only on some counters. Co-Authored-By: Martin Liska <marxin.liska@gmail.com> From-SVN: r201333
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/profile.c8
2 files changed, 12 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index d073a19..b99e074 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2013-07-30 Jan Hubicka <jh@suse.cz>
+ Martin Liska <marxin.liska@gmail.com>
+
+ * profile.c (compute_value_histograms): Do not ICE when
+ there is mismatch only on some counters.
+
2013-07-30 Zhenqiang Chen <zhenqiang.chen@linaro.org>
PR rtl-optimization/57637
diff --git a/gcc/profile.c b/gcc/profile.c
index b833398..4ad7c9f 100644
--- a/gcc/profile.c
+++ b/gcc/profile.c
@@ -885,12 +885,16 @@ compute_value_histograms (histogram_values values, unsigned cfg_checksum,
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++)