[Bug fortran/123943] [16 Regression] ice in gfc_resolve_forall, at fortran/resolve.cc:12646
cvs-commit at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sat Feb 14 14:20:10 GMT 2026
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 <anlauf@gcc.gnu.org>:
https://gcc.gnu.org/g:edced0fe1e28a37c75b4e2c80a2a12db93d5002c
commit r16-7513-gedced0fe1e28a37c75b4e2c80a2a12db93d5002c
Author: Christopher Albert <albert@tugraz.at>
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 <anlauf@gcc.gnu.org>
Signed-off-by: Christopher Albert <albert@tugraz.at>
More information about the Gcc-bugs
mailing list