https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89174
--- Comment #11 from Thomas Koenig <tkoenig at gcc dot gnu.org> --- Author: tkoenig Date: Sun Feb 24 22:49:47 2019 New Revision: 269179 URL: https://gcc.gnu.org/viewcvs?rev=269179&root=gcc&view=rev Log: 2019-02-24 Thomas Koenig <tkoe...@gcc.gnu.org> PR fortran/89174 * trans-expr.c (gfc_find_and_cut_at_last_class_ref): Add is_mold to garguments. If we are dealing with a MOLD, call gfc_expr_to_initialize(). * trans-stmt.c (gfc_trans_allocate): For MOLD, pass is_mold=true to gfc_find_and_cut_at_last_class_ref. * trans.h (gfc_find_and_cut_at_last_class_ref): Add optional argument is_mold with default false. 2019-02-24 Thomas Koenig <tkoe...@gcc.gnu.org> PR fortran/89174 * gfortran.dg/allocate_with_mold_3.f90: New test. Added: trunk/gcc/testsuite/gfortran.dg/allocate_with_mold_3.f90 Modified: trunk/gcc/fortran/ChangeLog trunk/gcc/fortran/trans-expr.c trunk/gcc/fortran/trans-stmt.c trunk/gcc/fortran/trans.h trunk/gcc/testsuite/ChangeLog