diff options
Diffstat (limited to 'gcc/passes.c')
-rw-r--r-- | gcc/passes.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/passes.c b/gcc/passes.c index 98e05e4..64493ba 100644 --- a/gcc/passes.c +++ b/gcc/passes.c @@ -60,6 +60,7 @@ along with GCC; see the file COPYING3. If not see #include "tree-ssa-live.h" /* For remove_unused_locals. */ #include "tree-cfgcleanup.h" #include "insn-addr.h" /* for INSN_ADDRESSES_ALLOC. */ +#include "diagnostic-core.h" /* for fnotice */ using namespace gcc; @@ -1779,6 +1780,24 @@ execute_function_dump (function *fn, void *data) } } +/* This function is called when an internal compiler error is encountered. + Ensure that function dump is made available before compiler is aborted. */ + +void +emergency_dump_function () +{ + if (!current_pass) + return; + enum opt_pass_type pt = current_pass->type; + fnotice (stderr, "during %s pass: %s\n", + pt == GIMPLE_PASS ? "GIMPLE" : pt == RTL_PASS ? "RTL" : "IPA", + current_pass->name); + if (!dump_file || !cfun) + return; + fnotice (stderr, "dump file: %s\n", dump_file_name); + execute_function_dump (cfun, current_pass); +} + static struct profile_record *profile_record; /* Do profile consistency book-keeping for the pass with static number INDEX. |