diff options
author | reichelt <reichelt@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-03-22 19:36:22 +0000 |
---|---|---|
committer | reichelt <reichelt@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-03-22 19:36:22 +0000 |
commit | 87011ef06ed381f5716d53222fb68a2ae0863436 (patch) | |
tree | 0ef1c23dc84a162b943f0131666ec56296a921be /gcc/gcc.c | |
parent | f23886abacad045dae2b04895dddea4aaec2db1c (diff) | |
download | gcc-87011ef06ed381f5716d53222fb68a2ae0863436.tar.gz |
PR driver/22600
* system.h (ICE_EXIT_CODE): New macro.
* diagnostic.c (diagnostic_count_diagnostic): Exit with ICE_EXIT_CODE.
(diagnostic_action_after_output): Likewise.
* gcc.c (fatal_ice): New function.
(execute): Use it instead of fatal.
(fancy_abort): Likewise.
* doc/invoke.texi (-pass-exit-codes): Document return code for ICEs.
* fortran/error.c (gfc_fatal_error): Return ICE_EXIT_CODE instead of 4.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@112292 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gcc.c')
-rw-r--r-- | gcc/gcc.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/gcc/gcc.c b/gcc/gcc.c index b7e9a1df339..c606773f42e 100644 --- a/gcc/gcc.c +++ b/gcc/gcc.c @@ -330,6 +330,7 @@ static int default_arg (const char *, int); static void set_multilib_dir (void); static void print_multilib_info (void); static void perror_with_name (const char *); +static void fatal_ice (const char *, ...) ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN; static void notice (const char *, ...) ATTRIBUTE_PRINTF_1; static void display_help (void); static void add_preprocessor_option (const char *, int); @@ -2997,12 +2998,12 @@ execute (void) } else #endif - fatal ("\ + fatal_ice ("\ Internal error: %s (program %s)\n\ Please submit a full bug report.\n\ See %s for instructions.", - strsignal (WTERMSIG (status)), commands[i].prog, - bug_report_url); + strsignal (WTERMSIG (status)), commands[i].prog, + bug_report_url); } else if (WIFEXITED (status) && WEXITSTATUS (status) >= MIN_FATAL_STATUS) @@ -6818,12 +6819,27 @@ perror_with_name (const char *name) void fancy_abort (const char *file, int line, const char *func) { - fatal ("internal gcc abort in %s, at %s:%d", func, file, line); + fatal_ice ("internal gcc abort in %s, at %s:%d", func, file, line); } /* Output an error message and exit. */ void +fatal_ice (const char *cmsgid, ...) +{ + va_list ap; + + va_start (ap, cmsgid); + + fprintf (stderr, "%s: ", programname); + vfprintf (stderr, _(cmsgid), ap); + va_end (ap); + fprintf (stderr, "\n"); + delete_temp_files (); + exit (pass_exit_codes ? ICE_EXIT_CODE : 1); +} + +void fatal (const char *cmsgid, ...) { va_list ap; |