https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119618

--- Comment #7 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <ja...@gcc.gnu.org>:

https://gcc.gnu.org/g:c89714d9df3ad8dd6b79946da85f5e276aba83db

commit r15-9209-gc89714d9df3ad8dd6b79946da85f5e276aba83db
Author: Jakub Jelinek <ja...@redhat.com>
Date:   Fri Apr 4 20:53:19 2025 +0200

    profile: Another musttail fix [PR119618]

    As the following testcase shows, sometimes we can have debug stmts
    after a musttail call and profile.cc in that case would incorrectly
    allow the edge from that, causing musttail error and -fcompare-debug
    failure (because if there are no debug stmts after it, then musttail
    is found there and the edge is ignored).

    The following patch uses gsi_last_nondebug_bb instead of gsi_last_bb
    to find the musttail call.  And so that we don't uselessly skip over
    debug stmts at the end of many bbs, the patch limits it to
    cfun->has_musttail functions.

    2025-04-04  Jakub Jelinek  <ja...@redhat.com>

            PR gcov-profile/119618
            * profile.cc (branch_prob): Only check for musttail calls if
            cfun->has_musttail.  Use gsi_last_nondebug_bb instead of
gsi_last_bb.

            * c-c++-common/pr119618.c: New test.

Reply via email to