https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98490
--- Comment #11 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Harald Anlauf <anl...@gcc.gnu.org>: https://gcc.gnu.org/g:5fe0865ab788bdc387b284a3ad57e5a95a767b18 commit r12-3432-g5fe0865ab788bdc387b284a3ad57e5a95a767b18 Author: Harald Anlauf <anl...@gmx.de> Date: Thu Sep 9 21:34:01 2021 +0200 Fortran - out of bounds in array constructor with implied do loop gcc/fortran/ChangeLog: PR fortran/98490 * trans-expr.c (gfc_conv_substring): Do not generate substring bounds check for implied do loop index variable before it actually becomes defined. gcc/testsuite/ChangeLog: PR fortran/98490 * gfortran.dg/bounds_check_23.f90: New test.