]> git.ipfire.org Git - thirdparty/gcc.git/commit
Fortran: fix passing of zero-sized array arguments to procedures [PR86277]
authorHarald Anlauf <anlauf@gmx.de>
Mon, 12 Jun 2023 21:08:48 +0000 (23:08 +0200)
committerHarald Anlauf <anlauf@gmx.de>
Tue, 13 Jun 2023 18:07:51 +0000 (20:07 +0200)
commitc1691509e5a8875f36c068a5ea101bf13f140948
treee810a17861c1946f9cbc95347f0cab4246f6b16f
parentb15d46e8057bf58b5e021011ee6e0c07d6cdf712
Fortran: fix passing of zero-sized array arguments to procedures [PR86277]

gcc/fortran/ChangeLog:

PR fortran/86277
* trans-array.cc (gfc_trans_allocate_array_storage): When passing a
zero-sized array with fixed (= non-dynamic) size, allocate temporary
by the caller, not by the callee.

gcc/testsuite/ChangeLog:

PR fortran/86277
* gfortran.dg/zero_sized_14.f90: New test.
* gfortran.dg/zero_sized_15.f90: New test.

Co-authored-by: Mikael Morin <mikael@gcc.gnu.org>
gcc/fortran/trans-array.cc
gcc/testsuite/gfortran.dg/zero_sized_14.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/zero_sized_15.f90 [new file with mode: 0644]