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>
* tree.c (build_type_no_quals): New function.
......@@ -179,17 +186,17 @@ Tue Nov 14 12:34:56 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
2000-11-13 Neil Booth <neilb@earthling.net>
* cpplex.c (_cpp_lex_token): CPP_COMMENT and true CPP_EOF
cases return without MI check.
* cpplib.c (do_diagnostic): Take boolean of whether to
print the directive name.
(do_error, do_warning): Update.
(do_pragma_dependency): Use it.
* cpplib.h (VARARGS_FIRST): Delete.
(struct cpp_token): Delete integer.
* cppmacro.c (enter_macro_context): Move disabled check
to _cpp_get_token.
(_cpp_get_token): Simplify into a single loop.
* cpplex.c (_cpp_lex_token): CPP_COMMENT and true CPP_EOF
cases return without MI check.
* cpplib.c (do_diagnostic): Take boolean of whether to
print the directive name.
(do_error, do_warning): Update.
(do_pragma_dependency): Use it.
* cpplib.h (VARARGS_FIRST): Delete.
(struct cpp_token): Delete integer.
* cppmacro.c (enter_macro_context): Move disabled check
to _cpp_get_token.
(_cpp_get_token): Simplify into a single loop.
2000-11-13 Richard Earnshaw <rearnsha@arm.com>
......
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>
* typeck.c (lookup_anon_field): Cope with qv qualifiers.
......
......@@ -259,6 +259,9 @@ friendly_abort (where, file, line, func)
if (where > 0)
error ("Internal error #%d.", where);
/* Uncount this error, so finish_abort will do the right thing. */
--errorcount;
fancy_abort (file, line, func);
}
......
......@@ -1638,11 +1638,8 @@ error_recursion ()
finish_diagnostic ();
fprintf (stderr,
"Internal compiler error: Error reporting routines re-entered.\n\
Please submit a full bug report.\n\
See %s for instructions.\n", GCCBUGURL);
exit (FATAL_EXIT_CODE);
"Internal compiler error: Error reporting routines re-entered.");
finish_abort ();
}
/* Given a partial pathname as input, return another pathname that
......@@ -1676,11 +1673,27 @@ fancy_abort (file, line, function)
int line;
const char *function;
{
fatal (
"Internal compiler error in %s, at %s:%d\n\
error ("Internal compiler error in %s, at %s:%d",
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\
See %s for instructions.",
function, trim_filename (file), line, GCCBUGURL);
See %s for instructions.\n",
GCCBUGURL);
exit (FATAL_EXIT_CODE);
}
/* Setup DC for reporting a diagnostic MESSAGE (an error of a WARNING),
......
......@@ -207,5 +207,6 @@ void record_last_error_module PARAMS ((void));
int error_function_changed PARAMS ((void));
void record_last_error_function PARAMS ((void));
void report_problematic_module PARAMS ((output_buffer *));
void finish_abort PARAMS ((void)) ATTRIBUTE_NORETURN;
#endif /* __GCC_DIAGNOSTIC_H__ */
......@@ -1685,9 +1685,8 @@ crash_signal (signo)
/* If this is missing, some compilers complain. */
int signo;
{
fatal ("Internal error: %s.\n\
Please submit a full bug report.\n\
See %s for instructions.", strsignal (signo), GCCBUGURL);
error ("Internal error: %s.", strsignal (signo));
finish_abort ();
}
/* 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