diff options
author | pault <pault@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-10-02 08:12:11 +0000 |
---|---|---|
committer | pault <pault@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-10-02 08:12:11 +0000 |
commit | 894ad0f31f144323951b45f86a675718bf019826 (patch) | |
tree | 409ec613fdef50ca2d2baae1ac3e2c1c7c53f2d1 /gcc/fortran/primary.c | |
parent | 87114d2e2a4622f66310057c1252c194f885d03d (diff) | |
download | gcc-894ad0f31f144323951b45f86a675718bf019826.tar.gz |
2007-10-02 Paul Thomas <pault@gcc.gnu.org>
PR fortran/33566
* primary.c (gfc_match_rvalue): Make all expressions with array
references to structure parameters into variable expressions.
2007-10-02 Paul Thomas <pault@gcc.gnu.org>
PR fortran/33566
* gfortran.dg/derived_comp_array_ref_5.f90: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@128951 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/primary.c')
-rw-r--r-- | gcc/fortran/primary.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/gcc/fortran/primary.c b/gcc/fortran/primary.c index 575a4c7411a..d5e4b64d26e 100644 --- a/gcc/fortran/primary.c +++ b/gcc/fortran/primary.c @@ -2148,18 +2148,17 @@ gfc_match_rvalue (gfc_expr **result) if (sym->ts.is_c_interop || sym->ts.is_iso_c) break; - /* Variable array references to use associated derived type - parameters cause all sorts of headaches in simplification. - For this reason, we write the parameter to the module and - treat them as variable references. */ - if (sym->value && sym->ts.type == BT_DERIVED - && sym->attr.use_assoc && e->ref) + /* Variable array references to derived type parameters cause + all sorts of headaches in simplification. Treating such + expressions as variable works just fine for all array + references. */ + if (sym->value && sym->ts.type == BT_DERIVED && e->ref) { for (ref = e->ref; ref; ref = ref->next) if (ref->type == REF_ARRAY) break; - if (ref == NULL) + if (ref == NULL || ref->u.ar.type == AR_FULL) break; ref = e->ref; |