diff options
| author | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-11-15 15:50:51 +0000 |
|---|---|---|
| committer | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-11-15 15:50:51 +0000 |
| commit | 2dd9ef432d87eef0964d5ec1ccd6d1397efaaf3f (patch) | |
| tree | f927bdafd430a86ad8fdd9549af9b7897ba84be5 /gcc/diagnostic.c | |
| parent | 211f311664516319ad48d5272f056d9298e7344e (diff) | |
| download | ppe42-gcc-2dd9ef432d87eef0964d5ec1ccd6d1397efaaf3f.tar.gz ppe42-gcc-2dd9ef432d87eef0964d5ec1ccd6d1397efaaf3f.zip | |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@37480 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/diagnostic.c')
| -rw-r--r-- | gcc/diagnostic.c | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/gcc/diagnostic.c b/gcc/diagnostic.c index 26ffa02d278..036b1ce3c90 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), |

