aboutsummaryrefslogtreecommitdiff
path: root/gcc/diagnostic.c
diff options
context:
space:
mode:
authorJason Merrill <jason@gcc.gnu.org>2000-11-15 10:50:51 -0500
committerJason Merrill <jason@gcc.gnu.org>2000-11-15 10:50:51 -0500
commitee3400e881ef5870dd6b1d274dfcd09c73828a1a (patch)
treef927bdafd430a86ad8fdd9549af9b7897ba84be5 /gcc/diagnostic.c
parent12e1243e426a12358e793cef2735e77c37452ec7 (diff)
downloadgcc-ee3400e881ef5870dd6b1d274dfcd09c73828a1a.zip
gcc-ee3400e881ef5870dd6b1d274dfcd09c73828a1a.tar.gz
gcc-ee3400e881ef5870dd6b1d274dfcd09c73828a1a.tar.bz2
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
Diffstat (limited to 'gcc/diagnostic.c')
-rw-r--r--gcc/diagnostic.c31
1 files changed, 22 insertions, 9 deletions
diff --git a/gcc/diagnostic.c b/gcc/diagnostic.c
index 26ffa02..036b1ce 100644
--- a/gcc/diagnostic.c
+++ b/gcc/diagnostic.c
@@ -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),