[Bug fortran/125532] Wrong-code in DO CONCURRENT when ASSOCIATE body references inline type-spec iterator

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sat Jun 6 17:21:22 GMT 2026


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

--- Comment #1 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jerry DeLisle <jvdelisle@gcc.gnu.org>:

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

commit r17-1395-gd84a302d4f0a440aa602f9688d339532a21c81a1
Author: Jerry DeLisle <jvdelisle@gcc.gnu.org>
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.

    PR fortran/125532

    Assisted by: Claude Sonnet 4.6

    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.


More information about the Gcc-bugs mailing list