From 508cef6d18cbabc050bbf0b70808c3d75c56e897 Mon Sep 17 00:00:00 2001 From: pault Date: Fri, 10 Nov 2006 17:21:57 +0000 Subject: 2006-11-10 Paul Thomas 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 PR fortran/29315 * gfortran.dg/aliasing_dummy_4.f90: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@118659 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/trans-expr.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'gcc/fortran/trans-expr.c') diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c index 9e44bfd3435..6f1e163d46a 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; } -- cgit v1.2.3