Fortran - out of bounds in array constructor with implied do loop
authorHarald Anlauf <anlauf@gmx.de>
Thu, 9 Sep 2021 19:34:01 +0000 (21:34 +0200)
committerHarald Anlauf <anlauf@gmx.de>
Thu, 9 Sep 2021 19:34:01 +0000 (21:34 +0200)
commit5fe0865ab788bdc387b284a3ad57e5a95a767b18
tree8f852312b8b5c3042d89dbf8c7ecee5f2d838b70
parentde515ce0b209cc7e5a780d9846e5154d380a763e
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.
gcc/fortran/trans-expr.c
gcc/testsuite/gfortran.dg/bounds_check_23.f90 [new file with mode: 0644]