https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65278
--- Comment #8 from Jan Hubicka <hubicka at ucw dot cz> --- > The offending insn gets created in rs6000_output_mi_thunk, but without the > patch there are no thunks, so this function doesn't even get called. > > Perhaps either Honza or David can comment on what needs to happen here, > whether > the icf code needs to be tweaked, or a non-local insn needs to be added to the > ppc backend. ICF itself does not produce thunk (it uses the expand_thunk to make real RTL wrappers, but it never uses the ASm machinery) so I suppose this may be a dup of PR65263? I can imagine that ICF merging actually keeps a real C++ tunk alive by differences of later optimizations and this thunk being redirected to externalsymbols. Does the patch in PR65263 help? Honza