On Mon, 8 Dec 2025, Richard Biener wrote:
> 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?
Ping.
Richard.
> 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 3c21e174943..51fc6d3f5ee 100644
> --- a/gcc/cgraph.cc
> +++ b/gcc/cgraph.cc
> @@ -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
> - || !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)
> {
>
--
Richard Biener <[email protected]>
SUSE Software Solutions Germany GmbH, Frankenstrasse 146, 90461 Nuernberg,
Germany; GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman;
HRB 36809 (AG Nuernberg)