https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92508
--- Comment #14 from Jan Hubicka <hubicka at ucw dot cz> --- > Did you use bootstrap-lto-lean (and not bootstrap-lto)? OK, I finally managed to reproduce and debug this. It is triggered by fact that bootstrap-lean is not training objc and other frontends which is probably not a good idea (at least from the objc developer POV). What happens is that we link trained libbacked with the untrained objc FE code and ICF then produces alias from objc FE function to trained funtion and the sanity check mistakely check count of alias instead of its ultimate target. I am testing: Index: ipa-inline-analysis.c =================================================================== --- ipa-inline-analysis.c (revision 278390) +++ ipa-inline-analysis.c (working copy) @@ -211,7 +211,7 @@ do_estimate_edge_time (struct cgraph_edg nonspec_time = e->entry.nonspec_time; hints = e->entry.hints; if (flag_checking - && !edge->callee->count.ipa_p ()) + && !callee->count.ipa_p ()) { sreal chk_time, chk_nonspec_time; int chk_size, chk_min_size;