http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60567
--- Comment #17 from Jakub Jelinek <jakub at gcc dot gnu.org> --- (In reply to Jan Hubicka from comment #15) > This patch fixes the ICE by copying forced_by_abi as part of cgraph fixup in > ipa visibility. I would like Jason to comment on this. I think fix at C++ > FE side would be more appropriate if the thunk is indeed keyed. > > If not, I will update partitinoning predicate to always iterate the whole > group and see if any of symbols is keyed. > > Index: ipa.c > =================================================================== > --- ipa.c (revision 209170) > +++ ipa.c (working copy) > @@ -1032,6 +1032,7 @@ function_and_variable_visibility (bool w > == DECL_COMDAT_GROUP (decl_node->decl)); > gcc_checking_assert (node->same_comdat_group); > } > + decl_node->forced_by_abi = node->forced_by_abi; > if (DECL_EXTERNAL (decl_node->decl)) > DECL_EXTERNAL (node->decl) = 1; > } Shouldn't that be the other way around though? node->forced_by_abi = decl_node->forced_by_abi; >From what I understand, decl_node is the target of the thunk, and node is thunk, on this testcase decl_node->forced_by_abi is true originally, while node->forced_by_abi is false. So, if the thunks are supposed to inherit the flag from the thunk target, we should change node->forced_by_abi, similarly how we e.g. change DECL_EXTERNAL (node->decl).