aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@acm.org>2017-08-28 13:44:39 +0000
committerNathan Sidwell <nathan@gcc.gnu.org>2017-08-28 13:44:39 +0000
commite54c2581c540202cc0d777c4de6185d95e663233 (patch)
treebed7057c0c3406840e32702879686f3f132853e6 /gcc
parent1963f60adb1ea775220cc92e0c644bbb59ad3191 (diff)
downloadgcc-e54c2581c540202cc0d777c4de6185d95e663233.zip
gcc-e54c2581c540202cc0d777c4de6185d95e663233.tar.gz
gcc-e54c2581c540202cc0d777c4de6185d95e663233.tar.bz2
gcc.c (execute): Fold SIGPIPE handling into switch statement.
* gcc.c (execute): Fold SIGPIPE handling into switch statement. Adjust internal error message. From-SVN: r251385
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/gcc.c75
2 files changed, 43 insertions, 37 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 8a35b28..abe7d85 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2017-08-28 Nathan Sidwell <nathan@acm.org>
+
+ * gcc.c (execute): Fold SIGPIPE handling into switch
+ statement. Adjust internal error message.
+
2017-08-28 Richard Biener <rguenther@suse.de>
PR debug/81993
diff --git a/gcc/gcc.c b/gcc/gcc.c
index 832a2e0..6fa5231 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -3135,49 +3135,50 @@ execute (void)
int status = statuses[i];
if (WIFSIGNALED (status))
- {
-#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))
- {
- signal_count++;
- ret_code = -1;
- }
- else
-#endif
- switch (WTERMSIG (status))
- {
- case SIGINT:
- /* SIGQUIT and SIGKILL are not available on MinGW. */
+ switch (WTERMSIG (status))
+ {
+ case SIGINT:
+ case SIGTERM:
+ /* SIGQUIT and SIGKILL are not available on MinGW. */
#ifdef SIGQUIT
- case SIGQUIT:
+ case SIGQUIT:
#endif
#ifdef SIGKILL
- case SIGKILL:
+ case SIGKILL:
#endif
- case SIGTERM:
- /* The user (or environment) did something to the
- inferior. Making this an ICE confuses the user
- into thinking there's a compiler bug. Much more
- likely is the user or OOM killer nuked it. */
- fatal_error (input_location,
- "%s signal terminated program %s",
- strsignal (WTERMSIG (status)),
- commands[i].prog);
+ /* The user (or environment) did something to the
+ inferior. Making this an ICE confuses the user into
+ thinking there's a compiler bug. Much more likely is
+ the user or OOM killer nuked it. */
+ fatal_error (input_location,
+ "%s signal terminated program %s",
+ strsignal (WTERMSIG (status)),
+ commands[i].prog);
+ break;
+
+#ifdef SIGPIPE
+ case 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 (signal_count || greatest_status >= MIN_FATAL_STATUS)
+ {
+ signal_count++;
+ ret_code = -1;
break;
- default:
- /* The inferior failed to catch the signal. */
- internal_error_no_backtrace ("%s (program %s)",
- strsignal (WTERMSIG (status)),
- commands[i].prog);
}
- }
+#endif
+ /* FALLTHROUGH */
+
+ default:
+ /* The inferior failed to catch the signal. */
+ internal_error_no_backtrace ("%s signal terminated program %s",
+ strsignal (WTERMSIG (status)),
+ commands[i].prog);
+ }
else if (WIFEXITED (status)
&& WEXITSTATUS (status) >= MIN_FATAL_STATUS)
{