https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83532
Jan Hubicka <hubicka at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2018-01-10 Ever confirmed|0 |1 --- Comment #1 from Jan Hubicka <hubicka at gcc dot gnu.org> --- Does this help? Seems we omit adjustment when producing partial function clone. Index: tree-inline.c =================================================================== --- tree-inline.c (revision 256324) +++ tree-inline.c (working copy) @@ -2683,7 +2683,6 @@ profile_count den = ENTRY_BLOCK_PTR_FOR_FN (src_cfun)->count; profile_count num = entry_block_map->count; - profile_count::adjust_for_ipa_scaling (&num, &den); cfun_to_copy = id->src_cfun = DECL_STRUCT_FUNCTION (callee_fndecl); @@ -2707,6 +2706,8 @@ ENTRY_BLOCK_PTR_FOR_FN (cfun)->count = den; } + profile_count::adjust_for_ipa_scaling (&num, &den); + /* Must have a CFG here at this point. */ gcc_assert (ENTRY_BLOCK_PTR_FOR_FN (DECL_STRUCT_FUNCTION (callee_fndecl)));