ortran: ICE using SHAPE with FINDLOC PR93835
authorMark Eggleston <markeggleston@gcc.gnu.org>
Mon, 24 Feb 2020 15:40:03 +0000 (15:40 +0000)
committerMark Eggleston <markeggleston@gcc.gnu.org>
Mon, 24 Feb 2020 15:40:03 +0000 (15:40 +0000)
commit27bf39a8035445ffc71b551619d7c1a232498054
tree8285da0bc6ad45669e4ac48e03a9d21cddc3833e
parentb07c085581eb98cde408d9583ee17d58832826ae
ortran: ICE using SHAPE with FINDLOC PR93835

The expression representing the array returned by SHAPE does not
have its shape defined. An ICE occurs when FINDLOC attempts to
use the shape of the array.  Add shape to expression before returning
from SHAPE.

Whitespace issues identified by Steven G. Kargl  <kargl@gcc.gnu.org>
have also been fixed.

gcc/fortran/ChangeLog

PR fortran/93835
* simplify.c (simplify_findloc_nodim) : Fix whitespace issues.
(gfc_simplify_shape) : Create and initialise one shape value
for the result expression. Set shape value with the rank of
the source array.

gcc/testsuite/ChangeLog

PR fortran/93835
* gfortran.dg/pr77351.f90 : Check for one error instead of two.
* gfortran.dg/pr93835.f08 : New test.
gcc/fortran/ChangeLog
gcc/fortran/simplify.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/pr77351.f90
gcc/testsuite/gfortran.dg/pr93835.f08 [new file with mode: 0644]