aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorAlexander Monakov <amonakov@ispras.ru>2017-08-03 16:39:47 +0300
committerAlexander Monakov <amonakov@gcc.gnu.org>2017-08-03 16:39:47 +0300
commit75560de5f5df4a003ecf80e28bf2b926ba758e55 (patch)
treeb4be28c423eff8d34a963ed82b921519d41aec2d /gcc
parent2d7744d4ef93bfffb484ae24b81163049364947f (diff)
downloadgcc-75560de5f5df4a003ecf80e28bf2b926ba758e55.zip
gcc-75560de5f5df4a003ecf80e28bf2b926ba758e55.tar.gz
gcc-75560de5f5df4a003ecf80e28bf2b926ba758e55.tar.bz2
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. From-SVN: r250854
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/toplev.c12
2 files changed, 18 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index d660e83..9e3a8aa 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2017-08-03 Alexander Monakov <amonakov@ispras.ru>
+
+ * toplev.c (dumpfile.h): New include.
+ (internal_error_reentered): New static function. Use it...
+ (internal_error_function): ...here to handle reentered internal_error.
+
2017-08-03 Richard Biener <rguenther@suse.de>
PR middle-end/81148
diff --git a/gcc/toplev.c b/gcc/toplev.c
index b28f184..48a79e2 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 ();
}