https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127023
--- Comment #9 from Josef Melcr <jmelcr at gcc dot gnu.org> ---
The edge redirection code in the target clone pass recreates references, but it
doesn't create them with their call statements set. This causes the code in
redirect_callee to not find the ref, as it cannot match it by its call
statement, which leads to the ICE. Seems like an easy fix, currently testing
the patch below.
diff --git a/gcc/multiple_target.cc b/gcc/multiple_target.cc
index 3f8676f5943..01d3ff84bf3 100644
--- a/gcc/multiple_target.cc
+++ b/gcc/multiple_target.cc
@@ -190,7 +190,7 @@ create_dispatcher_calls (struct cgraph_node *node)
}
symtab_node *source = ref->referring;
- source->create_reference (inode, IPA_REF_ADDR);
+ source->create_reference (inode, IPA_REF_ADDR, ref->stmt);
}
else if (ref->use == IPA_REF_ALIAS)
{