https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64872
--- Comment #2 from Jan Hubicka <hubicka at gcc dot gnu.org> --- Created attachment 34630 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=34630&action=edit Patch I am testing The problem is that ICF merge profiles and profile merging sometimes nukes the function body making it impossible to produce thunk later.