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

--- Comment #6 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <[email protected]>:

https://gcc.gnu.org/g:3012aad2dc6318ab490c4a2511f5b2e4d30652b9

commit r16-5482-g3012aad2dc6318ab490c4a2511f5b2e4d30652b9
Author: Jakub Jelinek <[email protected]>
Date:   Fri Nov 21 11:25:27 2025 +0100

    gimplify: Fix ICE in collect_fallthrough_labels [PR122773]

    In r16-4212 I had to tweak two spots in the gimplifier to ignore
    gotos jumping to labels with the new VACUOUS_INIT_LABEL_P flag
    (set by C++ FE when implementing goto/case interceptors with
    extra .DEFERRED_INIT calls, so that jumps over vacuous initialization
    are handled properly with the C++26 erroneous behavior requirements).
    Except as the following testcase shows, the checks blindly assumed
    that gimple_goto_dest operand is a LABEL_DECL, which is not the case
    for computed jumps.

    The following patch checks that gimple_goto_dest argument is a LABEL_DECL
    before testing VACUOUS_INIT_LABEL_P flag on it.

    2025-11-21  Jakub Jelinek  <[email protected]>

            PR middle-end/122773
            * gimplify.cc (collect_fallthrough_labels): Check whether
            gimple_goto_dest is a LABEL_DECL before testing
VACUOUS_INIT_LABEL_P.
            (expand_FALLTHROUGH_r): Likewise.

            * gcc.dg/pr122773.c: New test.

Reply via email to