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:27:17 +0000 (17:27 +0800)
commit6262e3a22b3d86afc116480bc59a7bb30b0cfd40
treed0720683ed7e0cc6e21395c79bb23c9a4d71fb29
parent31c200c6e110ced8732332376e69c0958985b926
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.
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