https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122456
--- Comment #28 from Richard Biener <rguenth at gcc dot gnu.org> ---
Possibly simple workaround:
diff --git a/gcc/cgraph.cc b/gcc/cgraph.cc
index 3c21e174943..0f63118b6c9 100644
--- a/gcc/cgraph.cc
+++ b/gcc/cgraph.cc
@@ -1528,6 +1528,7 @@ cgraph_edge::resolve_speculation (cgraph_edge *edge, tree
callee_decl)
ref = e2->speculative_call_target_ref ();
edge = edge->speculative_call_indirect_edge ();
if (!callee_decl
+ || !symtab_node::get (callee_decl)
|| !ref->referred->semantically_equivalent_p
(symtab_node::get (callee_decl)))
{