https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83506
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org --- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> --- --- cgraphunit.c.jj 2017-12-19 18:09:05.000000000 +0100 +++ cgraphunit.c 2017-12-20 11:00:55.141899011 +0100 @@ -354,6 +354,7 @@ symbol_table::process_new_functions (voi case EXPANSION: /* Functions created during expansion shall be compiled directly. */ + gimple_register_cfg_hooks (); node->process = 0; call_cgraph_insertion_hooks (node); node->expand (); fixes this, while node->expand (); calls gimple_register_cfg_hooks (), if we need the cfg hooks before, such as in the insertion hooks, it is too late.