[gcc r17-2759] gcc/driver: make SIGKILL/QUIT/... message clearer

Arsen Arsenovic arsen@gcc.gnu.org
Tue Jul 28 17:53:05 GMT 2026


https://gcc.gnu.org/g:42c1dc1948fde32c466b7f3783e8e0bad38d0e7f

commit r17-2759-g42c1dc1948fde32c466b7f3783e8e0bad38d0e7f
Author: Arsen Arsenović <aarsenovic@baylibre.com>
Date:   Wed Jul 22 13:50:52 2026 +0200

    gcc/driver: make SIGKILL/QUIT/... message clearer
    
    When a subprocess (say, lto1) gets killed by SIGKILL on Linux with
    LANG=en_..., the message GCC prints is "Killed signal terminated program
    lto1".
    
    This message is a little bit unclear - the "Killed" is certainly not
    something that gramatically fits there, and the syscall for sending a
    signal is called "kill", so the above sounds like an incorrect way of
    saying "program lto1 was killed by some signal".
    
    I can't find any decent description of what the correct class of words
    strsignal returns, so, lets instead print "PROG terminated by signal
    9 (Killed)".  This is clearer; it states that signal 9 is at fault and
    gives the OS-provided "descriptive string" corresponding to that signal.
    
    Example:
    
      ~/gcc/_b_gcc/gcc$ ./xgcc -B. -x c -
      xgcc: fatal error: cc1 terminated by signal 9 (Killed)
      compilation terminated.
      ~/gcc/_b_gcc/gcc 1 $
    
    gcc/ChangeLog:
    
            * gcc.cc (execute): Make "signal terminated program" message
            clearer.
    
    Suggested-by: Alexander Monakov <amonakov@ispras.ru>

Diff:
---
 gcc/gcc.cc | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/gcc/gcc.cc b/gcc/gcc.cc
index b8b0db4ed5e4..ca4e397bb5cb 100644
--- a/gcc/gcc.cc
+++ b/gcc/gcc.cc
@@ -3563,9 +3563,10 @@ execute (void)
 		 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);
+			   "%s terminated by signal %d (%s)",
+			   commands[i].prog,
+			   WTERMSIG (status),
+			   strsignal (WTERMSIG (status)));
 	      break;
 
 #ifdef SIGPIPE


More information about the Gcc-cvs mailing list