From dbeebc56bda05ec6b28f11e066248904c8f981fd Mon Sep 17 00:00:00 2001 From: Mikael Morin Date: Tue, 18 Oct 2011 15:11:21 +0000 Subject: [PATCH] re PR fortran/50420 ([Coarray] lcobound doesn't accept coarray subcomponents) PR fortran/50420 * simplify.c (simplify_cobound): Accept non-last-in-ref-chain coarrays. Don't set already set array ref. From-SVN: r180150 --- gcc/fortran/ChangeLog | 6 ++++++ gcc/fortran/simplify.c | 6 ++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 18e209f63be..2421c03fe76 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2011-10-18 Mikael Morin + + PR fortran/50420 + * simplify.c (simplify_cobound): Accept non-last-in-ref-chain coarrays. + Don't set already set array ref. + 2011-10-18 Mikael Morin * array.c (gfc_find_array_ref): Remove coarray-specific handling. diff --git a/gcc/fortran/simplify.c b/gcc/fortran/simplify.c index 13a9c5147c0..63689bb700c 100644 --- a/gcc/fortran/simplify.c +++ b/gcc/fortran/simplify.c @@ -3512,11 +3512,9 @@ simplify_cobound (gfc_expr *array, gfc_expr *dim, gfc_expr *kind, int upper) switch (ref->u.ar.type) { case AR_ELEMENT: - if (ref->next == NULL) + if (ref->u.ar.as->corank > 0) { - gcc_assert (ref->u.ar.as->corank > 0 - && ref->u.ar.as->rank == 0); - as = ref->u.ar.as; + gcc_assert (as == ref->u.ar.as); goto done; } as = NULL; -- 2.30.2