diff options
Diffstat (limited to 'gcc/fortran')
-rw-r--r-- | gcc/fortran/ChangeLog | 11 | ||||
-rw-r--r-- | gcc/fortran/resolve.c | 18 |
2 files changed, 29 insertions, 0 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 1d9d65c..ffc8629 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,14 @@ +2018-10-17 Paul Thomas <pault@gcc.gnu.org> + + PR fortran/56386 + PR fortran/58906 + PR fortran/77385 + PR fortran/80260 + PR fortran/82077 + * resolve.c (resolve_variable): Fix up expressions with array + associate names, where the parser did not detect that this is + array and there was no array part_ref in the expression. + 2018-10-16 Tobias Burnus <burnus@net-b.de> PR fortran/67125 diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index 56ab595..7c03816 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -5436,6 +5436,24 @@ resolve_variable (gfc_expr *e) gfc_fix_class_refs (e); if (!sym->attr.dimension && e->ref && e->ref->type == REF_ARRAY) return false; + else if (sym->attr.dimension && (!e->ref || e->ref->type != REF_ARRAY)) + { + /* This can happen because the parser did not detect that the + associate name is an array and the expression had no array + part_ref. */ + gfc_ref *ref = gfc_get_ref (); + ref->type = REF_ARRAY; + ref->u.ar = *gfc_get_array_ref(); + ref->u.ar.type = AR_FULL; + if (sym->as) + { + ref->u.ar.as = sym->as; + ref->u.ar.dimen = sym->as->rank; + } + ref->next = e->ref; + e->ref = ref; + + } } if (sym->ts.type == BT_DERIVED && sym->ts.u.derived->attr.generic) |