From eff7e72815ada5c70c974d42f6a419e29a03eb27 Mon Sep 17 00:00:00 2001 From: Harald Anlauf Date: Mon, 25 Nov 2024 22:55:10 +0100 Subject: Fortran: passing inquiry ref of complex array to assumed rank dummy [PR117774] PR fortran/117774 gcc/fortran/ChangeLog: * trans-expr.cc (gfc_conv_procedure_call): When passing an array to an assumed-rank dummy, terminate search for array reference of actual argument before an inquiry reference (e.g. INQUIRY_RE, INQUIRY_IM) so that bounds update works properly. gcc/testsuite/ChangeLog: * gfortran.dg/assumed_rank_25.f90: New test. --- gcc/fortran/trans-expr.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'gcc/fortran/trans-expr.cc') diff --git a/gcc/fortran/trans-expr.cc b/gcc/fortran/trans-expr.cc index bc1d5a8..41d06a9 100644 --- a/gcc/fortran/trans-expr.cc +++ b/gcc/fortran/trans-expr.cc @@ -7398,7 +7398,10 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym, /* Change AR_FULL to a (:,:,:) ref to force bounds update. */ gfc_ref *ref; for (ref = e->ref; ref->next; ref = ref->next) - ; + { + if (ref->next->type == REF_INQUIRY) + break; + }; if (ref->u.ar.type == AR_FULL && ref->u.ar.as->type != AS_ASSUMED_SIZE) ref->u.ar.type = AR_SECTION; -- cgit v1.1