gcc.c (execute): Emit friendlier message if inferior is killed by an external cause.
authorNathan Sidwell <nathan@acm.org>
Tue, 15 Aug 2017 12:44:58 +0000 (12:44 +0000)
committerNathan Sidwell <nathan@gcc.gnu.org>
Tue, 15 Aug 2017 12:44:58 +0000 (12:44 +0000)
* gcc.c (execute): Emit friendlier message if inferior is killed
by an external cause.

From-SVN: r251104

gcc/ChangeLog
gcc/gcc.c

index d899430111640f1c763a4c641de14f891d333682..c95dc2830a2d9833a56758857121923aef967405 100644 (file)
@@ -1,3 +1,8 @@
+2017-08-15  Nathan Sidwell  <nathan@acm.org>
+
+       * gcc.c (execute): Emit friendlier message if inferior is killed
+       by an external cause.
+
 2017-08-15  Richard Biener  <rguenther@suse.de>
 
        PR tree-optimization/81790
index 987eff55aa63abeed9a0d935c97816821fe2943d..96152dec87278f7f9491db4dbd2a03124547c42b 100644 (file)
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -3151,9 +3151,27 @@ execute (void)
              }
            else
 #endif
-             internal_error_no_backtrace ("%s (program %s)",
-                                          strsignal (WTERMSIG (status)),
-                                          commands[i].prog);
+             switch (WTERMSIG (status))
+               {
+               case SIGINT:
+               case SIGQUIT:
+               case SIGKILL:
+               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);
+                 break;
+               default:
+                 /* The inferior failed to catch the signal.  */
+                 internal_error_no_backtrace ("%s (program %s)",
+                                              strsignal (WTERMSIG (status)),
+                                              commands[i].prog);
+               }
          }
        else if (WIFEXITED (status)
                 && WEXITSTATUS (status) >= MIN_FATAL_STATUS)