commit:     4d2e2dcb337a4608bdda4d32d51fbdf93428167c
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sat Dec 13 22:08:09 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Dec 13 22:08:09 2025 +0000
URL:        https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=4d2e2dcb

16.0.0: update pgo workaround patch

https://inbox.sourceware.org/gcc-patches/20251208093029.1Mez96cZCp7gM2LYREScMr26HwC3HZ4pB8cpRN_dG48@z/

Signed-off-by: Sam James <sam <AT> gentoo.org>

 16.0.0/gentoo/86_all_PR122456-pgo-workaround.patch | 50 +++++++++++++++++++---
 16.0.0/gentoo/README.history                       |  4 ++
 2 files changed, 49 insertions(+), 5 deletions(-)

diff --git a/16.0.0/gentoo/86_all_PR122456-pgo-workaround.patch 
b/16.0.0/gentoo/86_all_PR122456-pgo-workaround.patch
index 1f9d204..3acc0f3 100644
--- a/16.0.0/gentoo/86_all_PR122456-pgo-workaround.patch
+++ b/16.0.0/gentoo/86_all_PR122456-pgo-workaround.patch
@@ -1,12 +1,52 @@
-https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122456#c28
+From fc4f5a36323e08e503ef7e487aca9f7ca4735fa0 Mon Sep 17 00:00:00 2001
+Message-ID: 
<fc4f5a36323e08e503ef7e487aca9f7ca4735fa0.1765663665.git....@gentoo.org>
+From: Richard Biener <[email protected]>
+Date: Mon, 8 Dec 2025 10:30:29 +0100
+Subject: [PATCH] ipa/122456 - fix ICE during LTO profiledbootstrap
+
+When we have a speculated edge but we folded the call to
+__builtin_unreachable () then trying to update the cgraph ICEs
+in resolve_speculation because there's no symtab node for
+__builtin_unreachable (). Reject this resolving attempt similar
+as to when the callees decl were NULL or it were not semantically
+equivalent.
+
+I only have a LTRANS unit as testcase.
+
+I've LTO profilebootstrapped this with the config that reproduced
+the error but I'm now doing a regular bootstrap/regtest as well.
+
+OK?
+
+Thanks,
+Richard.
+
+PR ipa/122456
+       * cgraph.cc (cgraph_edge::resolve_speculation): Handle
+       a NULL symtab_node::get (callee_decl).
+---
+ gcc/cgraph.cc | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/gcc/cgraph.cc b/gcc/cgraph.cc
+index 1a7d49922e09..ee5f2b411742 100644
 --- a/gcc/cgraph.cc
 +++ b/gcc/cgraph.cc
-@@ -1528,6 +1528,7 @@ cgraph_edge::resolve_speculation (cgraph_edge *edge, 
tree callee_decl)
+@@ -1527,9 +1527,10 @@ cgraph_edge::resolve_speculation (cgraph_edge *edge, 
tree callee_decl)
+     e2 = edge;
    ref = e2->speculative_call_target_ref ();
    edge = edge->speculative_call_indirect_edge ();
++  symtab_node *callee;
    if (!callee_decl
-+      || !symtab_node::get (callee_decl)
-       || !ref->referred->semantically_equivalent_p
-          (symtab_node::get (callee_decl)))
+-      || !ref->referred->semantically_equivalent_p
+-         (symtab_node::get (callee_decl)))
++      || !(callee = symtab_node::get (callee_decl))
++      || !ref->referred->semantically_equivalent_p (callee))
      {
+       if (dump_file)
+       {
+
+base-commit: 94d8ce172848b39de198eb7f6e07ccd3685ef66e
+-- 
+2.52.0
 

diff --git a/16.0.0/gentoo/README.history b/16.0.0/gentoo/README.history
index 60bb6fa..a964753 100644
--- a/16.0.0/gentoo/README.history
+++ b/16.0.0/gentoo/README.history
@@ -1,3 +1,7 @@
+27     ????
+
+       U 86_all_PR122456-pgo-workaround.patch
+
 26     7 December 2025
 
        + 37_all_PR66487-object-lifetime-instrumentation-for-Valgrind.patch

Reply via email to