re PR fortran/89363 (RANK incorrect for unallocated allocatable)
authorPaul Thomas <pault@gcc.gnu.org>
Tue, 12 Mar 2019 13:40:51 +0000 (13:40 +0000)
committerPaul Thomas <pault@gcc.gnu.org>
Tue, 12 Mar 2019 13:40:51 +0000 (13:40 +0000)
commit0e3088806577e8050d6cc10215196d5f57cb5aa4
tree8ddc5bde47fc6618007675a7a1be96502119d73d
parentc9634470ba8b918c01a7680740cf9ea13ca06967
re PR fortran/89363 (RANK incorrect for unallocated allocatable)

2019-03-12  Paul Thomas  <pault@gcc.gnu.org>

PR fortran/89363
PR fortran/89364
* trans-expr.c (set_dtype_for_unallocated): New function.
(gfc_conv_gfc_desc_to_cfi_desc): Call it for allocatable and
pointer arguments.
(gfc_conv_procedure_call): Likewise. Also, set the ubound of
the final dimension to -1 for assumed rank formal args that are
associated with assumed size arrays.
* trans-intrinsic.c (gfc_conv_intrinsic_bound): Return -1 for
the final dimension of assumed rank entities that are argument
associated with assumed size arrays.
(gfc_conv_intrinsic_shape): Likewise return -1 for the final
dimension of the shape intrinsic.

2019-03-12  Paul Thomas  <pault@gcc.gnu.org>

PR fortran/89363
* gfortran.dg/assumed_rank_16.f90: New test.

PR fortran/89364
* gfortran.dg/assumed_rank_17.f90: New test.

From-SVN: r269612
gcc/fortran/ChangeLog
gcc/fortran/trans-expr.c
gcc/fortran/trans-intrinsic.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/assumed_rank_16.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/assumed_rank_17.f90 [new file with mode: 0644]