Commit 75560de5 by Alexander Monakov Committed by Alexander Monakov

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
parent 2d7744d4
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> 2017-08-03 Richard Biener <rguenther@suse.de>
PR middle-end/81148 PR middle-end/81148
......
...@@ -80,6 +80,7 @@ along with GCC; see the file COPYING3. If not see ...@@ -80,6 +80,7 @@ along with GCC; see the file COPYING3. If not see
#include "hsa-common.h" #include "hsa-common.h"
#include "edit-context.h" #include "edit-context.h"
#include "tree-pass.h" #include "tree-pass.h"
#include "dumpfile.h"
#if defined(DBX_DEBUGGING_INFO) || defined(XCOFF_DEBUGGING_INFO) #if defined(DBX_DEBUGGING_INFO) || defined(XCOFF_DEBUGGING_INFO)
#include "dbxout.h" #include "dbxout.h"
...@@ -1064,11 +1065,22 @@ open_auxiliary_file (const char *ext) ...@@ -1064,11 +1065,22 @@ open_auxiliary_file (const char *ext)
return file; 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. */ /* Auxiliary callback for the diagnostics code. */
static void static void
internal_error_function (diagnostic_context *, const char *, va_list *) internal_error_function (diagnostic_context *, const char *, va_list *)
{ {
global_dc->internal_error = internal_error_reentered;
warn_if_plugins (); warn_if_plugins ();
emergency_dump_function (); emergency_dump_function ();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment