https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87284
--- Comment #1 from Paul Thomas <pault at gcc dot gnu.org> --- Author: pault Date: Wed Sep 12 18:33:13 2018 New Revision: 264249 URL: https://gcc.gnu.org/viewcvs?rev=264249&root=gcc&view=rev Log: 2018-09-12 Paul Thomas <pa...@gcc.gnu.org> PR fortran/87284 * trans-expr.c (gfc_trans_class_init_assign): Access to to array elements of the dynamic type requires that the array reference be added to the class expression and not the _data component, unlike scalar expressions. 2018-09-12 Paul Thomas <pa...@gcc.gnu.org> PR fortran/87284 * gfortran.dg/allocate_with_mold_2.f90: New test. Added: trunk/gcc/testsuite/gfortran.dg/allocate_with_mold_2.f90 Modified: trunk/gcc/fortran/ChangeLog trunk/gcc/fortran/trans-expr.c trunk/gcc/testsuite/ChangeLog