]> gcc.gnu.org Git - gcc.git/commit
Fortran: Handle allocated() with coindexed scalars [PR93834]
authorTobias Burnus <tobias@codesourcery.com>
Thu, 23 Sep 2021 16:47:45 +0000 (18:47 +0200)
committerTobias Burnus <tobias@codesourcery.com>
Thu, 23 Sep 2021 16:48:48 +0000 (18:48 +0200)
commit1b07d9dce6c51c98d011236c3d4cd84a2ed59ba2
tree69692653253ae23ae0fdd16ca84dd8d1b834d6c6
parentb3585c0836e729bed56b9afd4292177673a25ca0
Fortran: Handle allocated() with coindexed scalars [PR93834]

While for an allocatable 'array', 'array(:)' and 'array(:)[1]' are
not allocatable, it is believed that not only 'scalar' but also
'scalar[1]' is allocatable.  However, coarrays are collectively
established/allocated; thus, 'allocated(scalar[i])' is equivalent
to 'allocated(scalar)'. [At least when assuming that 'i' does not
refer to a failed image.]

2021-09-23  Harald Anlauf  <anlauf@gmx.de>
    Tobias Burnus  <tobias@codesourcery.com>

PR fortran/93834
gcc/fortran/ChangeLog:

* trans-intrinsic.c (gfc_conv_allocated): Cleanup. Handle
coindexed scalar coarrays.

gcc/testsuite/ChangeLog:

* gfortran.dg/coarray/coarray_allocated.f90: New test.
gcc/fortran/trans-intrinsic.c
gcc/testsuite/gfortran.dg/coarray/coarray_allocated.f90 [new file with mode: 0644]
This page took 0.064496 seconds and 5 git commands to generate.