aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/expr.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/fortran/expr.cc')
-rw-r--r--gcc/fortran/expr.cc12
1 files changed, 8 insertions, 4 deletions
diff --git a/gcc/fortran/expr.cc b/gcc/fortran/expr.cc
index e4ab3ba..9d84e76 100644
--- a/gcc/fortran/expr.cc
+++ b/gcc/fortran/expr.cc
@@ -629,6 +629,8 @@ gfc_free_ref_list (gfc_ref *p)
gfc_free_expr (p->u.ar.stride[i]);
}
+ gfc_free_expr (p->u.ar.stat);
+ gfc_free_expr (p->u.ar.team);
break;
case REF_SUBSTRING:
@@ -5840,18 +5842,20 @@ gfc_ref_this_image (gfc_ref *ref)
}
gfc_expr *
-gfc_find_team_co (gfc_expr *e)
+gfc_find_team_co (gfc_expr *e, enum gfc_array_ref_team_type req_team_type)
{
gfc_ref *ref;
for (ref = e->ref; ref; ref = ref->next)
- if (ref->type == REF_ARRAY && ref->u.ar.codimen > 0)
+ if (ref->type == REF_ARRAY && ref->u.ar.codimen > 0
+ && ref->u.ar.team_type == req_team_type)
return ref->u.ar.team;
- if (e->value.function.actual->expr)
+ if (e->expr_type == EXPR_FUNCTION && 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)
+ if (ref->type == REF_ARRAY && ref->u.ar.codimen > 0
+ && ref->u.ar.team_type == req_team_type)
return ref->u.ar.team;
return NULL;