diff options
author | Richard Biener <rguenther@suse.de> | 2016-08-23 07:21:36 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2016-08-23 07:21:36 +0000 |
commit | e83421c08ff730d683c4921c07cf7f327a6bab89 (patch) | |
tree | 8f992c41d246008a7f6df3c8ce1f03b2851b9d4b | |
parent | 9c810a4e44d42c6c5c6c7ac2ae141ad21e7b15ab (diff) | |
download | gcc-e83421c08ff730d683c4921c07cf7f327a6bab89.zip gcc-e83421c08ff730d683c4921c07cf7f327a6bab89.tar.gz gcc-e83421c08ff730d683c4921c07cf7f327a6bab89.tar.bz2 |
re PR lto/77305 (-fdump-tree-all and -flto causes ICE)
2016-08-23 Richard Biener <rguenther@suse.de>
PR middle-end/77305
* statistics.c (statistics_counter_event): Robustify against
NULL current_pass.
From-SVN: r239683
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/statistics.c | 7 |
2 files changed, 10 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b9798f1..42fe573 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2016-08-23 Richard Biener <rguenther@suse.de> + + PR middle-end/77305 + * statistics.c (statistics_counter_event): Robustify against + NULL current_pass. + 2016-08-23 Venkataramanan Kumar * config/i386/i386.c (processor_alias_table): Enable PTA_PRFCHW 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); |