diff options
| author | Paul Thomas <pault@gcc.gnu.org> | 2006-11-10 17:21:57 +0000 |
|---|---|---|
| committer | Paul Thomas <pault@gcc.gnu.org> | 2006-11-10 17:21:57 +0000 |
| commit | 95fe073894db31e7495109bbaf2251673e9d3ce4 (patch) | |
| tree | 8f99da864a8c9eb9ed8ea2089a5e47c1ccffb58c /gcc/fortran/trans-expr.c | |
| parent | 29520adf7d46186470718cbd7d277db6c85ac0be (diff) | |
| download | gcc-95fe073894db31e7495109bbaf2251673e9d3ce4.zip gcc-95fe073894db31e7495109bbaf2251673e9d3ce4.tar.gz gcc-95fe073894db31e7495109bbaf2251673e9d3ce4.tar.bz2 | |
re PR fortran/29315 (error passing an array derived from type element)
2006-11-10 Paul Thomas <pault@gcc.gnu.org>
PR fortran/29315
* trans-expr.c (is_aliased_array): Treat correctly the case where the
component is itself and array or array reference.
2006-11-10 Paul Thomas <pault@gcc.gnu.org>
PR fortran/29315
* gfortran.dg/aliasing_dummy_4.f90: New test.
From-SVN: r118659
Diffstat (limited to 'gcc/fortran/trans-expr.c')
| -rw-r--r-- | gcc/fortran/trans-expr.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c index 9e44bfd..6f1e163 100644 --- a/gcc/fortran/trans-expr.c +++ b/gcc/fortran/trans-expr.c @@ -1838,7 +1838,8 @@ gfc_conv_aliased_arg (gfc_se * parmse, gfc_expr * expr, return; } -/* Is true if the last array reference is followed by a component reference. */ +/* Is true if an array reference is followed by a component or substring + reference. */ static bool is_aliased_array (gfc_expr * e) @@ -1849,10 +1850,11 @@ is_aliased_array (gfc_expr * e) seen_array = false; for (ref = e->ref; ref; ref = ref->next) { - if (ref->type == REF_ARRAY) + if (ref->type == REF_ARRAY + && ref->u.ar.type != AR_ELEMENT) seen_array = true; - if (ref->next == NULL + if (seen_array && ref->type != REF_ARRAY) return seen_array; } |
