This patch recalculates dominance info before update_ssa call in AutoFDO. This fixes bug when dominance info is out-of-date and causes segfaults during update_ssa.
Bootstrapped and regression test on-going. OK for google-4_9 branch? Thanks, Dehao Index: gcc/auto-profile.c =================================================================== --- gcc/auto-profile.c (revision 216278) +++ gcc/auto-profile.c (working copy) @@ -1756,6 +1756,11 @@ auto_profile (void) early_inline (); autofdo::afdo_annotate_cfg (promoted_stmts); compute_function_frequency (); + + free_dominance_info (CDI_DOMINATORS); + free_dominance_info (CDI_POST_DOMINATORS); + calculate_dominance_info (CDI_POST_DOMINATORS); + calculate_dominance_info (CDI_DOMINATORS); update_ssa (TODO_update_ssa); /* Local pure-const may imply need to fixup the cfg. */