aboutsummaryrefslogtreecommitdiff
path: root/gcc/gcc.c
diff options
context:
space:
mode:
authorZack Weinberg <zack@gcc.gnu.org>2000-07-13 04:43:47 +0000
committerZack Weinberg <zack@gcc.gnu.org>2000-07-13 04:43:47 +0000
commitc334349bda917012f51f629988006f9c72b7288a (patch)
tree6de36bf7b8f48857cc3e90312c8d4589da6c3f6f /gcc/gcc.c
parentdcacfa04fe67a4f0c957d0b37e0c750d2036d34d (diff)
downloadgcc-c334349bda917012f51f629988006f9c72b7288a.zip
gcc-c334349bda917012f51f629988006f9c72b7288a.tar.gz
gcc-c334349bda917012f51f629988006f9c72b7288a.tar.bz2
gcc.c (execute): If a subprocess gets a fatal signal...
* gcc.c (execute): If a subprocess gets a fatal signal, report strsignal() of the signal number, and ask for a bug report. Do not do this for SIGPIPE if there's already been an error. * tradcpp.c: Don't include signal.h. Don't catch SIGPIPE. Delete pipe_closed. From-SVN: r35006
Diffstat (limited to 'gcc/gcc.c')
-rw-r--r--gcc/gcc.c43
1 files changed, 28 insertions, 15 deletions
diff --git a/gcc/gcc.c b/gcc/gcc.c
index a917e5d..c2e2a47 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -2653,22 +2653,35 @@ execute ()
if (commands[j].pid == pid)
{
i++;
- if (status != 0)
+ if (WIFSIGNALED (status))
{
- if (WIFSIGNALED (status))
- {
- fatal ("Internal compiler error: program %s got fatal signal %d",
- commands[j].prog, WTERMSIG (status));
- signal_count++;
- ret_code = -1;
- }
- else if (WIFEXITED (status)
- && WEXITSTATUS (status) >= MIN_FATAL_STATUS)
- {
- if (WEXITSTATUS (status) > greatest_status)
- greatest_status = WEXITSTATUS (status);
- ret_code = -1;
- }
+#ifdef SIGPIPE
+ /* SIGPIPE is a special case. It happens in -pipe mode
+ when the compiler dies before the preprocessor is
+ done, or the assembler dies before the compiler is
+ done. There's generally been an error already, and
+ this is just fallout. So don't generate another error
+ unless we would otherwise have succeeded. */
+ if (WTERMSIG (status) == SIGPIPE
+ && (signal_count || greatest_status >= MIN_FATAL_STATUS))
+ ;
+ else
+#endif
+ fatal ("\
+Internal error: %s (program %s)\n\
+Please submit a full bug report.\n\
+See %s for instructions.",
+ strsignal (WTERMSIG (status)), commands[j].prog,
+ GCCBUGURL);
+ signal_count++;
+ ret_code = -1;
+ }
+ else if (WIFEXITED (status)
+ && WEXITSTATUS (status) >= MIN_FATAL_STATUS)
+ {
+ if (WEXITSTATUS (status) > greatest_status)
+ greatest_status = WEXITSTATUS (status);
+ ret_code = -1;
}
#ifdef HAVE_GETRUSAGE
if (report_times && ut + st != 0)