re PR fortran/66035 (gfortran ICE segfault)
authorAndre Vehreschild <vehre@gcc.gnu.org>
Fri, 17 Jul 2015 10:16:21 +0000 (12:16 +0200)
committerAndre Vehreschild <vehre@gcc.gnu.org>
Fri, 17 Jul 2015 10:16:21 +0000 (12:16 +0200)
commit255388b8123b714d4bd91c6745dd811f9b4290fb
tree49a9263a209920a6310307f5dd0042055857250c
parent0e1f8c6a90834987f63f911a86d78e40d5577e80
re PR fortran/66035 (gfortran ICE segfault)

gcc/fortran/ChangeLog:

2015-07-17  Andre Vehreschild  <vehre@gcc.gnu.org>

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 a
component when the object to assign is not an allocatable class
object (the memory is already present for allocatable class objects).
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-07-17  Andre Vehreschild  <vehre@gcc.gnu.org>

PR fortran/66035
* gfortran.dg/structure_constructor_13.f03: New test.

From-SVN: r225928
gcc/fortran/ChangeLog
gcc/fortran/trans-expr.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/structure_constructor_13.f03 [new file with mode: 0644]