From badd9e6941c34112f782bf955877fe041dd20cc4 Mon Sep 17 00:00:00 2001 From: Tobias Burnus Date: Sat, 16 Jul 2011 19:31:13 +0200 Subject: expr.c (gfc_ref_this_image): New function. 2011-07-16 Tobias Burnus * expr.c (gfc_ref_this_image): New function. (gfc_is_coindexed): Use it. * gfortran.h (gfc_ref_this_image): New prototype. * resolve.c (resolve_deallocate_expr, resolve_allocate_expr): Support alloc scalar coarrays. * trans-array.c (gfc_conv_array_ref, gfc_array_init_size, gfc_conv_descriptor_cosize, gfc_array_allocate, gfc_trans_deferred_array): Ditto. * trans-expr.c (gfc_conv_variable) Ditto.: * trans-stmt.c (gfc_trans_deallocate): Ditto. * trans-types.c (gfc_get_element_type, gfc_get_array_type_bounds gfc_get_array_descr_info): Ditto. * trans-decl.c (gfc_get_symbol_decl): Ditto. 2011-07-16 Tobias Burnus * gfortran.dg/coarray_14.f90: Remove dg-error "sorry not * implemented". * gfortran.dg/coarray_7.f90: Ditto. * gfortran.dg/coarray/scalar_alloc_1.f90: New. * gfortran.dg/coarray/scalar_alloc_2.f90: New. From-SVN: r176358 --- gcc/fortran/resolve.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'gcc/fortran/resolve.c') diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index b51ae96..07104b8 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -6460,7 +6460,9 @@ resolve_deallocate_expr (gfc_expr *e) switch (ref->type) { case REF_ARRAY: - if (ref->u.ar.type != AR_FULL) + if (ref->u.ar.type != AR_FULL + && !(ref->u.ar.type == AR_ELEMENT && ref->u.ar.as->rank == 0 + && ref->u.ar.codimen && gfc_ref_this_image (ref))) allocatable = 0; break; @@ -6983,13 +6985,6 @@ check_symbols: goto failure; } - if (codimension && ar->as->rank == 0) - { - gfc_error ("Sorry, allocatable scalar coarrays are not yet supported " - "at %L", &e->where); - goto failure; - } - success: return SUCCESS; -- cgit v1.1