aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorNicolas KÃnig <koenigni@student.ethz.ch>2020-10-25 11:36:08 +0100
committerNicolas KÃnig <koenigni@student.ethz.ch>2020-10-25 11:36:44 +0100
commit9dca1f29608df4bda70b33be735373ac18b8714b (patch)
treed8caa926369e941c046975702b65b9174766a588 /gcc
parent7488585fc18a9466253617e251c0e0bdc168a3b1 (diff)
downloadgcc-9dca1f29608df4bda70b33be735373ac18b8714b.zip
gcc-9dca1f29608df4bda70b33be735373ac18b8714b.tar.gz
gcc-9dca1f29608df4bda70b33be735373ac18b8714b.tar.bz2
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.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/fortran/trans-array.c4
1 files changed, 2 insertions, 2 deletions
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,