aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/trans-expr.c
diff options
context:
space:
mode:
authorPaul Thomas <pault@gcc.gnu.org>2018-06-21 17:34:31 +0000
committerPaul Thomas <pault@gcc.gnu.org>2018-06-21 17:34:31 +0000
commit75382a9665aa26d35ed2d5f18b2943223ab07b05 (patch)
treeb16d6362bc01c10d44f13604f3b352d4176cd089 /gcc/fortran/trans-expr.c
parent7792f13c845a8dc97e6b0a8023d81c67e8d650d2 (diff)
downloadgcc-75382a9665aa26d35ed2d5f18b2943223ab07b05.zip
gcc-75382a9665aa26d35ed2d5f18b2943223ab07b05.tar.gz
gcc-75382a9665aa26d35ed2d5f18b2943223ab07b05.tar.bz2
re PR fortran/83118 (Bad intrinsic assignment of class(*) array component of derived type)
2018-06-21 Paul Thomas <pault@gcc.gnu.org> PR fortran/83118 * resolve.c (resolve_ordinary_assign): Force the creation of a vtable for assignment of non-polymorphic expressions to an unlimited polymorphic object. * trans-array.c (gfc_alloc_allocatable_for_assignment): Use the size of the rhs type for such assignments. Set the dtype, _len and vptrs appropriately. * trans-expr.c (gfc_trans_assignment): Force the use of the _copy function for these assignments. 2018-06-21 Paul Thomas <pault@gcc.gnu.org> PR fortran/83118 * gfortran.dg/unlimited_polymorphic_30.f03: New test. From-SVN: r261857
Diffstat (limited to 'gcc/fortran/trans-expr.c')
-rw-r--r--gcc/fortran/trans-expr.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c
index b2a645b..f369b1b 100644
--- a/gcc/fortran/trans-expr.c
+++ b/gcc/fortran/trans-expr.c
@@ -10437,6 +10437,10 @@ gfc_trans_assignment (gfc_expr * expr1, gfc_expr * expr2, bool init_flag,
return tmp;
}
+ if (UNLIMITED_POLY (expr1) && expr1->rank
+ && expr2->ts.type != BT_CLASS)
+ use_vptr_copy = true;
+
/* Fallback to the scalarizer to generate explicit loops. */
return gfc_trans_assignment_1 (expr1, expr2, init_flag, dealloc,
use_vptr_copy, may_alias);