Commit ee3400e8 by Jason Merrill

diagnostic.c (finish_abort): New fn.

        * diagnostic.c (finish_abort): New fn.
        (fancy_abort, error_recursion): Use it.
        * toplev.c (crash_signal): Likewise.
        * diagnostic.h: Declare it.

        * typeck2.c (friendly_abort): Uncount the error before handing
        off to fancy_abort.

From-SVN: r37480
parent 12e1243e
2000-11-15 Jason Merrill <jason@redhat.com>
* diagnostic.c (finish_abort): New fn.
(fancy_abort, error_recursion): Use it.
* toplev.c (crash_signal): Likewise.
* diagnostic.h: Declare it.
2000-11-13 Andrew Haley <aph@redhat.com> 2000-11-13 Andrew Haley <aph@redhat.com>
* tree.c (build_type_no_quals): New function. * tree.c (build_type_no_quals): New function.
......
2000-11-15 Jason Merrill <jason@redhat.com>
* typeck2.c (friendly_abort): Uncount the error before handing
off to fancy_abort.
2000-11-15 Nathan Sidwell <nathan@codesourcery.com> 2000-11-15 Nathan Sidwell <nathan@codesourcery.com>
* typeck.c (lookup_anon_field): Cope with qv qualifiers. * typeck.c (lookup_anon_field): Cope with qv qualifiers.
......
...@@ -259,6 +259,9 @@ friendly_abort (where, file, line, func) ...@@ -259,6 +259,9 @@ friendly_abort (where, file, line, func)
if (where > 0) if (where > 0)
error ("Internal error #%d.", where); error ("Internal error #%d.", where);
/* Uncount this error, so finish_abort will do the right thing. */
--errorcount;
fancy_abort (file, line, func); fancy_abort (file, line, func);
} }
......
...@@ -1638,11 +1638,8 @@ error_recursion () ...@@ -1638,11 +1638,8 @@ error_recursion ()
finish_diagnostic (); finish_diagnostic ();
fprintf (stderr, fprintf (stderr,
"Internal compiler error: Error reporting routines re-entered.\n\ "Internal compiler error: Error reporting routines re-entered.");
Please submit a full bug report.\n\ finish_abort ();
See %s for instructions.\n", GCCBUGURL);
exit (FATAL_EXIT_CODE);
} }
/* Given a partial pathname as input, return another pathname that /* Given a partial pathname as input, return another pathname that
...@@ -1676,11 +1673,27 @@ fancy_abort (file, line, function) ...@@ -1676,11 +1673,27 @@ fancy_abort (file, line, function)
int line; int line;
const char *function; const char *function;
{ {
fatal ( error ("Internal compiler error in %s, at %s:%d",
"Internal compiler error in %s, at %s:%d\n\ function, trim_filename (file), line);
finish_abort ();
}
/* Finish reporting an internal compiler error. If the only error we've
seen is the current one, encourage the user to file a bug report;
otherwise, fixing their code will probably avoid the crash. */
void
finish_abort ()
{
if (errorcount > 1 || sorrycount > 0)
fprintf (stderr, "confused by earlier errors, bailing out\n");
else
fprintf (stderr, "\
Please submit a full bug report.\n\ Please submit a full bug report.\n\
See %s for instructions.", See %s for instructions.\n",
function, trim_filename (file), line, GCCBUGURL); GCCBUGURL);
exit (FATAL_EXIT_CODE);
} }
/* Setup DC for reporting a diagnostic MESSAGE (an error of a WARNING), /* Setup DC for reporting a diagnostic MESSAGE (an error of a WARNING),
......
...@@ -207,5 +207,6 @@ void record_last_error_module PARAMS ((void)); ...@@ -207,5 +207,6 @@ void record_last_error_module PARAMS ((void));
int error_function_changed PARAMS ((void)); int error_function_changed PARAMS ((void));
void record_last_error_function PARAMS ((void)); void record_last_error_function PARAMS ((void));
void report_problematic_module PARAMS ((output_buffer *)); void report_problematic_module PARAMS ((output_buffer *));
void finish_abort PARAMS ((void)) ATTRIBUTE_NORETURN;
#endif /* __GCC_DIAGNOSTIC_H__ */ #endif /* __GCC_DIAGNOSTIC_H__ */
...@@ -1685,9 +1685,8 @@ crash_signal (signo) ...@@ -1685,9 +1685,8 @@ crash_signal (signo)
/* If this is missing, some compilers complain. */ /* If this is missing, some compilers complain. */
int signo; int signo;
{ {
fatal ("Internal error: %s.\n\ error ("Internal error: %s.", strsignal (signo));
Please submit a full bug report.\n\ finish_abort ();
See %s for instructions.", strsignal (signo), GCCBUGURL);
} }
/* Strip off a legitimate source ending from the input string NAME of /* Strip off a legitimate source ending from the input string NAME of
......
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