From 9dca1f29608df4bda70b33be735373ac18b8714b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20K=C3=83nig?= Date: Sun, 25 Oct 2020 11:36:08 +0100 Subject: Check for correct type of ref before trying to handle coarrays. gcc/fortran/ChangeLog: PR native_coarray/97530 * trans-array.c (gfc_conv_ss_descriptor): Check for correct type of ref before handling coarrays. --- gcc/fortran/trans-array.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gcc') diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c index 55a63e3..261759d 100644 --- a/gcc/fortran/trans-array.c +++ b/gcc/fortran/trans-array.c @@ -3040,7 +3040,7 @@ gfc_conv_ss_descriptor (stmtblock_t * block, gfc_ss * ss, int base) /* If we have a native coarray with implied this_image (), add the appropriate offset to the data pointer. */ ref = ss_info->expr->ref; - if (flag_coarray == GFC_FCOARRAY_SHARED && ref + if (flag_coarray == GFC_FCOARRAY_SHARED && ref && ref->type == REF_ARRAY && ref->u.ar.dimen_type[ref->u.ar.dimen + ref->u.ar.codimen - 1] == DIMEN_THIS_IMAGE) tmp = gfc_native_coarray_add_this_image_offset (tmp, se.expr, &ref->u.ar, 1, 1); @@ -3060,7 +3060,7 @@ gfc_conv_ss_descriptor (stmtblock_t * block, gfc_ss * ss, int base) offset for the codimensions. */ // TODO: check whether the recipient is a coarray, if it is, disable // all of this - if (flag_coarray == GFC_FCOARRAY_SHARED && ref + if (flag_coarray == GFC_FCOARRAY_SHARED && ref && ref->type == REF_ARRAY && ref->u.ar.dimen_type[ref->u.ar.dimen + ref->u.ar.codimen - 1] == DIMEN_THIS_IMAGE) tmp = gfc_add_strides (tmp, se.expr, ref->u.ar.as->rank, -- cgit v1.1