https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117774
anlauf at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |anlauf at gcc dot gnu.org --- Comment #3 from anlauf at gcc dot gnu.org --- I am currently regtesting a third patch: diff --git a/gcc/fortran/trans-expr.cc b/gcc/fortran/trans-expr.cc index bc1d5a87307..2622fabc929 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; We need to terminate the search for the array reference early when there is an inquiry reference.