aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/expr.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/fortran/expr.c')
-rw-r--r--gcc/fortran/expr.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c
index 2a5f8ec..40f20c9 100644
--- a/gcc/fortran/expr.c
+++ b/gcc/fortran/expr.c
@@ -5060,7 +5060,25 @@ gfc_ref_this_image (gfc_ref *ref)
}
gfc_expr *
-gfc_find_stat_co(gfc_expr *e)
+gfc_find_team_co (gfc_expr *e)
+{
+ gfc_ref *ref;
+
+ for (ref = e->ref; ref; ref = ref->next)
+ if (ref->type == REF_ARRAY && ref->u.ar.codimen > 0)
+ return ref->u.ar.team;
+
+ if (e->value.function.actual->expr)
+ for (ref = e->value.function.actual->expr->ref; ref;
+ ref = ref->next)
+ if (ref->type == REF_ARRAY && ref->u.ar.codimen > 0)
+ return ref->u.ar.team;
+
+ return NULL;
+}
+
+gfc_expr *
+gfc_find_stat_co (gfc_expr *e)
{
gfc_ref *ref;