From: Nicolas KÃnig Date: Sun, 25 Oct 2020 10:36:08 +0000 (+0100) Subject: Check for correct type of ref before trying to handle coarrays. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9dca1f29608df4bda70b33be735373ac18b8714b;p=thirdparty%2Fgcc.git 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. --- diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c index 55a63e359aef..261759d3e794 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,