https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107925
--- Comment #9 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Martin Jambor <jamb...@gcc.gnu.org>: https://gcc.gnu.org/g:1526ecd739fc6a13329abdcbdbf7c2df57c22177 commit r13-6667-g1526ecd739fc6a13329abdcbdbf7c2df57c22177 Author: Martin Jambor <mjam...@suse.cz> Date: Tue Mar 14 18:53:16 2023 +0100 ipa-cp: Improve updating behavior when profile counts have gone bad Looking into the behavior of profile count updating in PR 107925, I noticed that an option not considered possible was actually happening, and - with the guesswork in place to distribute unexplained counts - it simply can happen. Currently it is handled by dropping the counts to local estimated zero, whereas it is probably better to leave the count as they are but drop the category to GUESSED_GLOBAL0 - which is what profile_count::combine_with_ipa_count in a similar case (or so I hope :-) gcc/ChangeLog: 2023-02-20 Martin Jambor <mjam...@suse.cz> PR ipa/107925 * ipa-cp.cc (update_profiling_info): Drop counts of orig_node to global0 instead of zeroing when it does not have as many counts as it should.