aboutsummaryrefslogtreecommitdiff
path: root/gcc/passes.c
diff options
context:
space:
mode:
authorAlexander Monakov <amonakov@ispras.ru>2017-05-31 16:26:54 +0300
committerAlexander Monakov <amonakov@gcc.gnu.org>2017-05-31 16:26:54 +0300
commita02d1ad2b2973bcc047715b39df2ff1c69385541 (patch)
treefdbe3a3801dc53192204548b33b1e35001a07498 /gcc/passes.c
parent1e466f0496649db71f5e62881feea8ee59e09874 (diff)
downloadgcc-a02d1ad2b2973bcc047715b39df2ff1c69385541.zip
gcc-a02d1ad2b2973bcc047715b39df2ff1c69385541.tar.gz
gcc-a02d1ad2b2973bcc047715b39df2ff1c69385541.tar.bz2
passes.c: implement pre-ICE emergency dumping
* passes.c (emergency_dump_function): New. * tree-pass.h (emergency_dump_function): Declare. * plugin.c (plugins_internal_error_function): Remove. * plugin.h (plugins_internal_error_function): Remove declaration. * toplev.c (internal_error_function): New static function. Use it... (general_init): ...here. From-SVN: r248736
Diffstat (limited to 'gcc/passes.c')
-rw-r--r--gcc/passes.c19
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.