aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/trans-expr.c
diff options
context:
space:
mode:
authorJosé Rui Faustino de Sousa <jrfsousa@gmail.com>2020-06-11 13:24:55 +0200
committerThomas Koenig <tkoenig@gcc.gnu.org>2020-06-11 13:25:59 +0200
commit6a07010b774cb5a0b1790b857e69d3d8534eebd2 (patch)
treeddfeb25691fdab43f36f9aea41814c539064755e /gcc/fortran/trans-expr.c
parent419c355c7a871513e1065b7cec32dd456eb4a0e5 (diff)
downloadgcc-6a07010b774cb5a0b1790b857e69d3d8534eebd2.zip
gcc-6a07010b774cb5a0b1790b857e69d3d8534eebd2.tar.gz
gcc-6a07010b774cb5a0b1790b857e69d3d8534eebd2.tar.bz2
Patch to Bug 94022 - Array slices of assumed-size arrays.
Make sure that when passing array sections of assumed-size arrays to procedures expecting an assumed-rank array the upper bound of the last dimension of the array section does not get improperly reset to -1 to mark it has an assumed size array. gcc/fortran/ChangeLog: 2020-06-11 José Rui Faustino de Sousa <jrfsousa@gmail.com> PR fortran/94022 * trans-expr.c (gfc_conv_procedure_call): In the case of assumed-size arrays ensure that the reference is to a full array. gcc/testsuite/ChangeLog: 2020-06-11 José Rui Faustino de Sousa <jrfsousa@gmail.com> PR fortran/94022 * gfortran.dg/PR94022.f90: New test.
Diffstat (limited to 'gcc/fortran/trans-expr.c')
-rw-r--r--gcc/fortran/trans-expr.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c
index 8b2afd2..b7c568e 100644
--- a/gcc/fortran/trans-expr.c
+++ b/gcc/fortran/trans-expr.c
@@ -6244,6 +6244,8 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
|| gfc_expr_attr (e).allocatable)
set_dtype_for_unallocated (&parmse, e);
else if (e->expr_type == EXPR_VARIABLE
+ && e->ref
+ && e->ref->u.ar.type == AR_FULL
&& e->symtree->n.sym->attr.dummy
&& e->symtree->n.sym->as
&& e->symtree->n.sym->as->type == AS_ASSUMED_SIZE)