https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118581
--- Comment #6 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by hongtao Liu <liuho...@gcc.gnu.org>: https://gcc.gnu.org/g:59e853308bd797f91df15fd0fa65a3b5ce2cf4a2 commit r16-274-g59e853308bd797f91df15fd0fa65a3b5ce2cf4a2 Author: hongtao.liu <hongtao....@intel.com> Date: Wed Jan 22 07:44:01 2025 +0100 Annotate empty bb with all debug_stmt with location of phi in the single_succ. For an empty BB with all debug_stmt, it will be ignored by afdo_set_bb_count, but it can be set with count of single successors PHIs which edge from the BB. gcc/ChangeLog: PR gcov-profile/118581 * auto-profile.cc (autofdo_source_profile::get_count_info): Overload the function with parameter gimple location instead of stmt. (afdo_set_bb_count): For !has_annotated BB, Check single successors PHIs corresponding to the block and use those count.