aboutsummaryrefslogtreecommitdiff
path: root/gcc/toplev.c
diff options
context:
space:
mode:
authorAlexander Monakov <amonakov@ispras.ru>2017-08-03 13:39:47 +0000
committerAlexander Monakov <amonakov@ispras.ru>2017-08-03 13:39:47 +0000
commitaf62d6ec14ccaf0114d183bb15901693cf3d5f37 (patch)
treeb4be28c423eff8d34a963ed82b921519d41aec2d /gcc/toplev.c
parent65834714d06e516570d5a9736d9cfd9e52a62071 (diff)
toplev: avoid recursive emergency_dump_function
* toplev.c (dumpfile.h): New include. (internal_error_reentered): New static function. Use it... (internal_error_function): ...here to handle reentered internal_error. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@250854 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/toplev.c')
-rw-r--r--gcc/toplev.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/toplev.c b/gcc/toplev.c
index b28f1847c83..48a79e28d99 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -80,6 +80,7 @@ along with GCC; see the file COPYING3. If not see
#include "hsa-common.h"
#include "edit-context.h"
#include "tree-pass.h"
+#include "dumpfile.h"
#if defined(DBX_DEBUGGING_INFO) || defined(XCOFF_DEBUGGING_INFO)
#include "dbxout.h"
@@ -1064,11 +1065,22 @@ open_auxiliary_file (const char *ext)
return file;
}
+/* Alternative diagnostics callback for reentered ICE reporting. */
+
+static void
+internal_error_reentered (diagnostic_context *, const char *, va_list *)
+{
+ /* Flush the dump file if emergency_dump_function itself caused an ICE. */
+ if (dump_file)
+ fflush (dump_file);
+}
+
/* Auxiliary callback for the diagnostics code. */
static void
internal_error_function (diagnostic_context *, const char *, va_list *)
{
+ global_dc->internal_error = internal_error_reentered;
warn_if_plugins ();
emergency_dump_function ();
}