Commit e54c2581 by Nathan Sidwell Committed by Nathan Sidwell

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
parent 1963f60a
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> 2017-08-28 Richard Biener <rguenther@suse.de>
PR debug/81993 PR debug/81993
......
...@@ -3135,25 +3135,10 @@ execute (void) ...@@ -3135,25 +3135,10 @@ execute (void)
int status = statuses[i]; int status = statuses[i];
if (WIFSIGNALED (status)) 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)) switch (WTERMSIG (status))
{ {
case SIGINT: case SIGINT:
case SIGTERM:
/* SIGQUIT and SIGKILL are not available on MinGW. */ /* SIGQUIT and SIGKILL are not available on MinGW. */
#ifdef SIGQUIT #ifdef SIGQUIT
case SIGQUIT: case SIGQUIT:
...@@ -3161,23 +3146,39 @@ execute (void) ...@@ -3161,23 +3146,39 @@ execute (void)
#ifdef SIGKILL #ifdef SIGKILL
case SIGKILL: case SIGKILL:
#endif #endif
case SIGTERM:
/* The user (or environment) did something to the /* The user (or environment) did something to the
inferior. Making this an ICE confuses the user inferior. Making this an ICE confuses the user into
into thinking there's a compiler bug. Much more thinking there's a compiler bug. Much more likely is
likely is the user or OOM killer nuked it. */ the user or OOM killer nuked it. */
fatal_error (input_location, fatal_error (input_location,
"%s signal terminated program %s", "%s signal terminated program %s",
strsignal (WTERMSIG (status)), strsignal (WTERMSIG (status)),
commands[i].prog); commands[i].prog);
break; 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;
}
#endif
/* FALLTHROUGH */
default: default:
/* The inferior failed to catch the signal. */ /* The inferior failed to catch the signal. */
internal_error_no_backtrace ("%s (program %s)", internal_error_no_backtrace ("%s signal terminated program %s",
strsignal (WTERMSIG (status)), strsignal (WTERMSIG (status)),
commands[i].prog); commands[i].prog);
} }
}
else if (WIFEXITED (status) else if (WIFEXITED (status)
&& WEXITSTATUS (status) >= MIN_FATAL_STATUS) && WEXITSTATUS (status) >= MIN_FATAL_STATUS)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment