https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105554
--- Comment #13 from Jakub Jelinek <jakub at gcc dot gnu.org> --- A lot of ipa passes use push_cfun: grep push_cfun ipa*.cc ipa-fnsummary.cc: push_cfun (DECL_STRUCT_FUNCTION (node->decl)); ipa-fnsummary.cc: push_cfun (DECL_STRUCT_FUNCTION (node->decl)); ipa-modref.cc: push_cfun (f); ipa-modref.cc: push_cfun (DECL_STRUCT_FUNCTION (node->decl)); ipa-modref.cc: push_cfun (DECL_STRUCT_FUNCTION (node->decl)); ipa-prop.cc: push_cfun (func); ipa-pure-const.cc: push_cfun (DECL_STRUCT_FUNCTION (decl)); ipa-sra.cc: push_cfun (DECL_STRUCT_FUNCTION (node->decl)); ipa-sra.cc: push_cfun (fun); ipa-utils.cc: push_cfun (dstcfun); ipa-visibility.cc: push_cfun (DECL_STRUCT_FUNCTION (e->caller->decl)); ipa-visibility.cc: push_cfun (DECL_STRUCT_FUNCTION (e->caller->decl)); After all, even create_target_clone -> create_version_clone_with_body -> tree_function_versioning already called and and then pop_cfun () again. multiple-target.cc is something so seldom used that another push_cfun/pop_cfun around the newly proposed loop wouldn't be that bad.