https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105459
--- Comment #7 from Kewen Lin <linkw at gcc dot gnu.org> --- I wonder if it's fine to move init_function_start downward after execute_all_ipa_transforms call? the testing is ongoing. --- a/gcc/cgraphunit.cc +++ b/gcc/cgraphunit.cc @@ -1817,7 +1817,6 @@ cgraph_node::expand (void) gcc_assert (DECL_STRUCT_FUNCTION (decl)); push_cfun (DECL_STRUCT_FUNCTION (decl)); - init_function_start (decl); gimple_register_cfg_hooks (); @@ -1827,6 +1826,8 @@ cgraph_node::expand (void) if (ipa_transforms_to_apply.exists ()) execute_all_ipa_transforms (false); + init_function_start (decl); + /* Perform all tree transforms and optimizations. */