https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64465
--- Comment #9 from Jakub Jelinek <jakub at gcc dot gnu.org> --- I believe with function versioning you create a new function and fixup_cfg pass is what will be run first on that, isn't that the case? In any case, there is no guarantee TODO_cleanup_cfg will be executed right after function versioning, so the changes should be postponed till it will be ensured. The inliner on the other side always uses TODO_cleanup_cfg and thus should be safe.