* expr.c (gfc_get_corank): Return 0 if input expression is not a
coarray.
From-SVN: r179675
2011-10-07 Mikael Morin <mikael.morin@sfr.fr>
+ * expr.c (gfc_get_corank): Return 0 if input expression is not a
+ coarray.
+
+2011-10-07 Mikael Morin <mikael.morin@sfr.fr>
+
* trans-array.c (gfc_conv_expr_descriptor): Simplify coarray
descriptor setup code.
{
int corank;
gfc_ref *ref;
+
+ if (!gfc_is_coarray (e))
+ return 0;
+
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;
}