aboutsummaryrefslogtreecommitdiff
path: root/gcc/statistics.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/statistics.c')
-rw-r--r--gcc/statistics.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/gcc/statistics.c b/gcc/statistics.c
index 24ee28e..ec5cefd 100644
--- a/gcc/statistics.c
+++ b/gcc/statistics.c
@@ -312,7 +312,8 @@ statistics_counter_event (struct function *fn, const char *id, int incr)
|| incr == 0)
return;
- if (current_pass->static_pass_number != -1)
+ if (current_pass
+ && current_pass->static_pass_number != -1)
{
counter = lookup_or_add_counter (curr_statistics_hash (), id, 0, false);
gcc_assert (!counter->histogram_p);
@@ -325,8 +326,8 @@ statistics_counter_event (struct function *fn, const char *id, int incr)
fprintf (statistics_dump_file,
"%d %s \"%s\" \"%s\" %d\n",
- current_pass->static_pass_number,
- current_pass->name,
+ current_pass ? current_pass->static_pass_number : -1,
+ current_pass ? current_pass->name : "none",
id,
function_name (fn),
incr);