summaryrefslogtreecommitdiffstats
path: root/gcc/fortran
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/fortran')
-rw-r--r--gcc/fortran/ChangeLog6
-rw-r--r--gcc/fortran/trans-expr.c8
2 files changed, 11 insertions, 3 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index d756df33337..25ed17ea1c7 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,9 @@
+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-09 Brooks Moses <brooks.moses@codesourcery.com>
* check.c (same_type_check): Typo fix in comment.
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;
}
OpenPOWER on IntegriCloud