diff options
author | Tobias Burnus <burnus@net-b.de> | 2010-07-08 17:17:25 +0200 |
---|---|---|
committer | Tobias Burnus <burnus@gcc.gnu.org> | 2010-07-08 17:17:25 +0200 |
commit | 7aa0849ad23d89d0a899e0216e20b3c8cc18d8b2 (patch) | |
tree | 144b7a9da68a553d288934276e31c4520a1da9b9 /gcc/fortran/expr.c | |
parent | d0c422cb29c67f05b7696f7cadf55b3455124f00 (diff) | |
download | gcc-7aa0849ad23d89d0a899e0216e20b3c8cc18d8b2.zip gcc-7aa0849ad23d89d0a899e0216e20b3c8cc18d8b2.tar.gz gcc-7aa0849ad23d89d0a899e0216e20b3c8cc18d8b2.tar.bz2 |
re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays])
2010-07-08 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* array.c (gfc_match_array_ref): Better error message for
coarrays with too few ranks.
(match_subscript): Move one diagnostic to caller.
* gfortran.h (gfc_get_corank): Add prottype.
* expr.c (gfc_get_corank): New function.
* iresolve.c (resolve_bound): Fix rank for cobounds.
(gfc_resolve_lbound,gfc_resolve_lcobound, gfc_resolve_ubound,
gfc_resolve_ucobound, gfc_resolve_this_image): Update
resolve_bound call.
2010-07-08 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* gfortran.dg/coarray_10.f90: Add an additional test.
From-SVN: r161960
Diffstat (limited to 'gcc/fortran/expr.c')
-rw-r--r-- | gcc/fortran/expr.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c index 12a46a9..acbec8d 100644 --- a/gcc/fortran/expr.c +++ b/gcc/fortran/expr.c @@ -4022,6 +4022,22 @@ gfc_is_coindexed (gfc_expr *e) } +bool +gfc_get_corank (gfc_expr *e) +{ + int corank; + gfc_ref *ref; + corank = e->symtree->n.sym->as ? e->symtree->n.sym->as->corank : 0; + for (ref = e->ref; ref; ref = ref->next) + { + if (ref->type == REF_ARRAY) + corank = ref->u.ar.as->corank; + gcc_assert (ref->type != REF_SUBSTRING); + } + return corank; +} + + /* Check whether the expression has an ultimate allocatable component. Being itself allocatable does not count. */ bool |