+2011-04-23 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/18918
+ * module.c (mio_array_spec): Set as->cotype on reading.
+ * resolve.c (resolve_allocate_expr): Fix allocating coarray
+ components.
+
2011-04-21 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/48405
mio_integer (&as->corank);
as->type = MIO_NAME (array_type) (as->type, array_spec_types);
+ if (iomode == IO_INPUT && as->corank)
+ as->cotype = (as->type == AS_DEFERRED) ? AS_DEFERRED : AS_EXPLICIT;
+
for (i = 0; i < as->rank + as->corank; i++)
{
mio_expr (&as->lower[i]);
{
int i, pointer, allocatable, dimension, is_abstract;
int codimension;
+ bool coindexed;
symbol_attribute attr;
gfc_ref *ref, *ref2;
gfc_expr *e2;
codimension = sym->attr.codimension;
}
+ coindexed = false;
+
for (ref = e->ref; ref; ref2 = ref, ref = ref->next)
{
switch (ref->type)
{
case REF_ARRAY:
+ if (ref->u.ar.codimen > 0)
+ {
+ int n;
+ for (n = ref->u.ar.dimen;
+ n < ref->u.ar.dimen + ref->u.ar.codimen; n++)
+ if (ref->u.ar.dimen_type[n] != DIMEN_THIS_IMAGE)
+ {
+ coindexed = true;
+ break;
+ }
+ }
+
if (ref->next != NULL)
pointer = 0;
break;
case REF_COMPONENT:
/* F2008, C644. */
- if (gfc_is_coindexed (e))
+ if (coindexed)
{
gfc_error ("Coindexed allocatable object at %L",
&e->where);
+2011-04-23 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/18918
+ * gfortran.dg/coarray_19.f90: New.
+
2011-04-23 Jakub Jelinek <jakub@redhat.com>
PR c/48685
--- /dev/null
+! { dg-do compile }
+! { dg-options "-fcoarray=single" }
+!
+! PR fortran/18918
+!
+
+! Was failing before as the "x%a()[]" was
+! regarded as coindexed
+subroutine test2()
+ type t
+ integer, allocatable :: a(:)[:]
+ end type t
+ type(t), SAVE :: x
+ allocate(x%a(1)[*])
+end subroutine test2
+
+
+module m
+ integer, allocatable :: a(:)[:]
+end module m
+
+! Was failing as "a" was allocatable but
+! as->cotype was not AS_DEFERERED.
+use m
+end
+
+! { dg-final { cleanup-modules "m" } }