https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105306
--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Created attachment 52832 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52832&action=edit gcc12-pr105306.patch Untested fix. Initializing semantic_interposition flag from flag_semantic_interposition works well only if all the cgraph nodes are created while those fndecls are current_function_decl, but that isn't always the case.