https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65972
Sebastian Pop <spop at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dehao at gcc dot gnu.org, | |dehao at google dot com --- Comment #4 from Sebastian Pop <spop at gcc dot gnu.org> --- This patch seems to fix the problem: diff --git a/gcc/auto-profile.c b/gcc/auto-profile.c index ba2d5ab..6bd296a 100644 --- a/gcc/auto-profile.c +++ b/gcc/auto-profile.c @@ -1547,6 +1547,9 @@ afdo_annotate_cfg (const stmt_set &promoted_stmts) static void early_inline () { + /* compute_inline_parameters needs an up to date SSA form. */ + update_ssa (TODO_update_ssa); + compute_inline_parameters (cgraph_node::get (current_function_decl), true); unsigned todo = early_inliner (cfun); if (todo & TODO_update_ssa_any) We have not verified yet which other pass is causing the SSA to be in an inconsistent state: instead of adding a call to update_ssa() at this place, we should have a verify_ssa(), and fix the other pass.