aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/trans-array.c
diff options
context:
space:
mode:
authorPaul Thomas <pault@gcc.gnu.org>2019-09-29 10:12:42 +0000
committerPaul Thomas <pault@gcc.gnu.org>2019-09-29 10:12:42 +0000
commit56b070e3bbc4364f86357d6651fe1391464db6d6 (patch)
tree5f12959555e00cf9a1cbc41639212e59d4d5a50d /gcc/fortran/trans-array.c
parentae517a31c9508d9b0424e7a057d05840cf2caaf5 (diff)
downloadgcc-56b070e3bbc4364f86357d6651fe1391464db6d6.zip
gcc-56b070e3bbc4364f86357d6651fe1391464db6d6.tar.gz
gcc-56b070e3bbc4364f86357d6651fe1391464db6d6.tar.bz2
re PR fortran/91726 (ICE in gfc_conv_array_ref, at fortran/trans-array.c:3612)
2019-09-29 Paul Thomas <pault@gcc.gnu.org> PR fortran/91726 * resolve.c (gfc_expr_to_initialize): Bail out with a copy of the original expression if the array ref is a scalar and the array_spec has corank. * trans-array.c (gfc_conv_array_ref): Such expressions are OK even if the array ref codimen is zero. * trans-expr.c (gfc_get_class_from_expr): New function taken from gfc_get_vptr_from_expr. (gfc_get_vptr_from_expr): Call new function. * trans-stmt.c (trans_associate_var): If one of these is a target expression, extract the class expression from the target and copy its fields to a new target variable. * trans.h : Add prototype for gfc_get_class_from_expr. 2019-09-29 Paul Thomas <pault@gcc.gnu.org> PR fortran/91726 * gfortran.dg/coarray_poly_9.f90 : New test. From-SVN: r276269
Diffstat (limited to 'gcc/fortran/trans-array.c')
-rw-r--r--gcc/fortran/trans-array.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c
index 07c4d7e..437892a 100644
--- a/gcc/fortran/trans-array.c
+++ b/gcc/fortran/trans-array.c
@@ -3609,7 +3609,8 @@ gfc_conv_array_ref (gfc_se * se, gfc_array_ref * ar, gfc_expr *expr,
if (ar->dimen == 0)
{
- gcc_assert (ar->codimen || sym->attr.select_rank_temporary);
+ gcc_assert (ar->codimen || sym->attr.select_rank_temporary
+ || (ar->as && ar->as->corank));
if (GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (se->expr)))
se->expr = build_fold_indirect_ref (gfc_conv_array_data (se->expr));