Here's another ICE patch that has proved helpful in reducing confusion about
which version of the compiler crashed. Namely print the version info in the ICE
output.
nathan
--
Nathan Sidwell
From d6948ad42f8fb188bb1cc0c2c94aab2c8d7b57d4 Mon Sep 17 00:00:00 2001
From: Nathan Sidwell <[email protected]>
Date: Sun, 1 Feb 2026 12:27:21 -0500
Subject: [PATCH] Print version info on ICE
gcc/
* diagnostics/context.cc (context::action_after_output):
Print compiler version information in ICE info.
---
gcc/diagnostics/context.cc | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gcc/diagnostics/context.cc b/gcc/diagnostics/context.cc
index 4c24e5660d0..2718f70f601 100644
--- a/gcc/diagnostics/context.cc
+++ b/gcc/diagnostics/context.cc
@@ -1022,14 +1022,14 @@ context::action_after_output (enum kind diag_kind)
if (m_abort_on_error)
real_abort ();
+ fnotice (stderr, "GCC %s%s\n", pkgversion_string, version_string);
+
bool space = false;
for (auto *argv = saved_argv; *argv; space = true)
fnotice (stderr, &" %s"[1 - space], *argv++);
fnotice (stderr, "\n");
freeargv (saved_argv);
- fnotice (stderr, "GCC %s%s\n", pkgversion_string, version_string);
-
if (m_report_bug)
fnotice (stderr, "Please submit a full bug report, "
"with preprocessed source.\n");
--
2.52.0