Hi, this patch fixes ICE in somewhat rare situation when thunk is inlined and later promoted into a comdat group. The reduced testcase in the PR no longer reproduces as it relies on quite fragile inlining decisions, but it would be nice to have re-reduced one.
Bootstrapped/regtested x86_64-linux, comitted to trunk so far. Honza PR ipa/80763 * ipa-comdats.c (set_comdat_group): Only set comdat group of real symbols; not inline clones. Index: ipa-comdats.c =================================================================== --- ipa-comdats.c (revision 256332) +++ ipa-comdats.c (working copy) @@ -211,8 +211,11 @@ set_comdat_group (symtab_node *symbol, symtab_node *head = (symtab_node *)head_p; gcc_assert (!symbol->get_comdat_group ()); - symbol->set_comdat_group (head->get_comdat_group ()); - symbol->add_to_same_comdat_group (head); + if (symbol->real_symbol_p ()) + { + symbol->set_comdat_group (head->get_comdat_group ()); + symbol->add_to_same_comdat_group (head); + } return false; }