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

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

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

commit r16-7513-gedced0fe1e28a37c75b4e2c80a2a12db93d5002c
Author: Christopher Albert <[email protected]>
Date:   Thu Feb 12 00:06:13 2026 +0100

    fortran: Fix DO CONCURRENT nested-in-block iterator counting [PR123943]

    Fix iterator-depth pre-counting in gfc_resolve_forall for nested
    DO CONCURRENT/FORALL constructs inside block arms (e.g. IF/ELSE,
    SELECT CASE).  The previous logic only scanned a flat next-chain,
    which could undercount and trigger an ICE assertion.

    Add a regression test based on a reduced testcase from Harald Anlauf.
    Adjust wording in one comment to avoid GNU-style checker complaints.

            PR fortran/123943

    gcc/fortran/ChangeLog:

            * resolve.cc (gfc_max_forall_iterators_in_chain): New helper
            function for factorization of iterator-depth counting.
            (gfc_count_forall_iterators): Use it.

    gcc/testsuite/ChangeLog:

            * gfortran.dg/pr123943.f90: New test.

    Co-authored-by: Harald Anlauf <[email protected]>
    Signed-off-by: Christopher Albert <[email protected]>

Reply via email to