]> git.ipfire.org Git - thirdparty/gcc.git/commit
fortran: Fix setting of array lower bound for named arrays
authorChung-Lin Tang <cltang@codesourcery.com>
Fri, 3 Dec 2021 09:27:17 +0000 (17:27 +0800)
committerChung-Lin Tang <cltang@codesourcery.com>
Fri, 3 Dec 2021 09:29:48 +0000 (17:29 +0800)
commit3fb6b575593f29dc5d9daba457deb6ec4b932667
tree1958f433f06105f84fc289c0ae21e9547a9fcb09
parent26235a5182e1402a2460340b6494e463125801b9
fortran: Fix setting of array lower bound for named arrays

This patch fixes a case of setting array low-bounds, found for particular uses
of SOURCE=/MOLD=. This adjusts the relevant part in gfc_trans_allocate() to
set e3_has_nodescriptor only for non-named arrays.

2021-12-03  Tobias Burnus  <tobias@codesourcery.com>

gcc/fortran/ChangeLog:

* trans-stmt.c (gfc_trans_allocate): Set e3_has_nodescriptor to true
only for non-named arrays.

gcc/testsuite/ChangeLog:

* gfortran.dg/allocate_with_source_26.f90: Adjust testcase.
* gfortran.dg/allocate_with_mold_4.f90: New testcase.

(cherry picked from commit 6262e3a22b3d86afc116480bc59a7bb30b0cfd40)
gcc/fortran/trans-stmt.c
gcc/testsuite/gfortran.dg/allocate_with_mold_4.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/allocate_with_source_26.f90