gcc/fortran/ChangeLog: 2015-05-08 Andre Vehreschild PR fortran/66035 * trans-expr.c (alloc_scalar_allocatable_for_subcomponent_assignment): Compute the size to allocate for class and derived type objects correclty. (gfc_trans_subcomponent_assign): Only allocate memory for the component when the object to assign is not a allocatable class object. Furthermore use copy_class_to_class for assigning the rhs to the component (may happen for dummy class objects on the rhs). gcc/testsuite/ChangeLog: 2015-05-08 Andre Vehreschild PR fortran/66035 * gfortran.dg/structure_constructor_13.f03: New test.