Thanks to Christopher.
Fairly simple fix.
Jerry
commit 97965bdc1ed36f97a6e2ec2ee7bc208dd05d8c18 (HEAD -> master, origin/master,
origin/HEAD)
Author: Christopher Albert <[email protected]>
Date: Mon Feb 23 22:42:44 2026 +0100
fortran: Fix iterator counting in nested block scopes [PR fortran/124208]
Count FORALL/DO CONCURRENT iterators in EXEC_BLOCK namespace code chains
while sizing VAR_EXPR in gfc_resolve_forall.
This prevents undersized allocation and an ICE for nested FORALL/DO
CONCURRENT inside ASSOCIATE/BLOCK constructs.
PR fortran/124208
gcc/fortran/ChangeLog:
* resolve.cc (gfc_max_forall_iterators_in_chain): Count
iterators in EXEC_BLOCK namespaces.
gcc/testsuite/ChangeLog:
* gfortran.dg/pr124208.f90: New test.
Signed-off-by: Christopher Albert <[email protected]>