aboutsummaryrefslogtreecommitdiff
path: root/gcc/statistics.c
diff options
context:
space:
mode:
authorAndrey Belevantsev <abel@ispras.ru>2009-06-03 18:36:47 +0400
committerAndrey Belevantsev <abel@gcc.gnu.org>2009-06-03 18:36:47 +0400
commit5e1b50f68bda115d24af7f9ff13196e488eb59a5 (patch)
treeae6f5c68f65ac74be8e21a8c67a9cecb919eb150 /gcc/statistics.c
parent6f11d6900d932c1e64e77f84d98b954ed6aba798 (diff)
downloadgcc-5e1b50f68bda115d24af7f9ff13196e488eb59a5.zip
gcc-5e1b50f68bda115d24af7f9ff13196e488eb59a5.tar.gz
gcc-5e1b50f68bda115d24af7f9ff13196e488eb59a5.tar.bz2
statistics.c (statistics_counter_event): Do not record event in pass dump if its number == -1.
* statistics.c (statistics_counter_event): Do not record event in pass dump if its number == -1. (curr_statistics_hash): Add assert that we never get passes with static number == -1. From-SVN: r148131
Diffstat (limited to 'gcc/statistics.c')
-rw-r--r--gcc/statistics.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/gcc/statistics.c b/gcc/statistics.c
index d2f665f..b7bfd45 100644
--- a/gcc/statistics.c
+++ b/gcc/statistics.c
@@ -82,7 +82,10 @@ hash_statistics_free (void *p)
static htab_t
curr_statistics_hash (void)
{
- unsigned idx = current_pass->static_pass_number;
+ unsigned idx;
+
+ gcc_assert (current_pass->static_pass_number >= 0);
+ idx = current_pass->static_pass_number;
if (idx < nr_statistics_hashes
&& statistics_hashes[idx] != NULL)
@@ -294,9 +297,12 @@ statistics_counter_event (struct function *fn, const char *id, int incr)
|| incr == 0)
return;
- counter = lookup_or_add_counter (curr_statistics_hash (), id, 0, false);
- gcc_assert (!counter->histogram_p);
- counter->count += incr;
+ if (current_pass->static_pass_number != -1)
+ {
+ counter = lookup_or_add_counter (curr_statistics_hash (), id, 0, false);
+ gcc_assert (!counter->histogram_p);
+ counter->count += incr;
+ }
if (!statistics_dump_file
|| !(statistics_dump_flags & TDF_DETAILS))