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

--- Comment #15 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-14 branch has been updated by Andrew Pinski
<pins...@gcc.gnu.org>:

https://gcc.gnu.org/g:5f6285f2918f1835ec7c35c37cbec8c10a091b57

commit r14-11617-g5f6285f2918f1835ec7c35c37cbec8c10a091b57
Author: Andrew Pinski <quic_apin...@quicinc.com>
Date:   Sat Mar 15 16:37:41 2025 -0700

    discriminators: Fix assigning discriminators on edge [PR113546]

    The problem here is there was a compare debug since the discriminators
    would still take into account debug statements. For the edge we would look
    at the first statement after the labels and that might have been a debug
statement.
    So we need to skip over debug statements otherwise we could get different
    discriminators # with and without -g.

    Bootstrapped and tested on x86_64-linux-gnu with no regressions.

            PR middle-end/113546

    gcc/ChangeLog:

            * tree-cfg.cc (first_non_label_stmt): Rename to ...
            (first_non_label_nondebug_stmt): This and use
gsi_start_nondebug_after_labels_bb.
            (assign_discriminators): Update call to
first_non_label_nondebug_stmt.

    gcc/testsuite/ChangeLog:

            * c-c++-common/torture/pr113546-1.c: New test.

    Signed-off-by: Andrew Pinski <quic_apin...@quicinc.com>
    (cherry picked from commit c5ca45b8069229b6ad9bc845f03f46340f6316d7)

Reply via email to