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

--- Comment #2 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-16 branch has been updated by Jerry DeLisle
<[email protected]>:

https://gcc.gnu.org/g:7810623e8cfa82e5d0d1952e8443a0c88f140690

commit r16-9103-g7810623e8cfa82e5d0d1952e8443a0c88f140690
Author: Jerry DeLisle <[email protected]>
Date:   Sat Jun 6 10:06:17 2026 -0700

    fortran: wrong-code in DO CONCURRENT with ASSOCIATE

    When an ASSOCIATE body references inline type-spec iterator,
    replace_in_code_recursive lacked a case for EXEC_BLOCK
    (associate constructs).  So, it silently skipped both
    the ASSOCIATE selector expressions and the body when
    replacing shadow iterator references.

    Add case EXEC_BLOCK to iterate over each selector's target
    expression via replace_in_expr_recursive and recurse into
    the body namespace's code list via replace_in_code_recursive.

    Assisted-by: Claude Sonnet 4.6

    PR fortran/125532

    gcc/fortran/ChangeLog:

            * resolve.cc (replace_in_code_recursive): Add EXEC_BLOCK case to
            replace shadow iterator references in ASSOCIATE selector
expressions
            and the ASSOCIATE body namespace.

    gcc/testsuite/ChangeLog:

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

    (cherry picked from commit e363588d7386e54fdaa8910df52f3cddfe062cb4)

Reply via email to