re PR fortran/56008 ([F03] wrong code with lhs-realloc on assignment with derived...
authorPaul Thomas <pault@gcc.gnu.org>
Mon, 4 Feb 2013 22:33:15 +0000 (22:33 +0000)
committerPaul Thomas <pault@gcc.gnu.org>
Mon, 4 Feb 2013 22:33:15 +0000 (22:33 +0000)
commit16e247566db1df18a63965f8b3da7345459c6296
treeb050a17024c43f8e674ed0aa5a78ec65c9e5d061
parent9ccd841a07944a30a4c17df1b0dd274b7e1c4431
re PR fortran/56008 ([F03] wrong code with lhs-realloc on assignment with derived types having allocatable components)

2013-02-04  Paul Thomas  <pault@gcc.gnu.org>

PR fortran/56008
PR fortran/47517
* trans-array.c (gfc_alloc_allocatable_for_assignment): Save
the lhs descriptor before it is modified for reallocation. Use
it to deallocate allocatable components in the reallocation
block.  Nullify allocatable components for newly (re)allocated
arrays.

2013-02-04  Paul Thomas  <pault@gcc.gnu.org>

PR fortran/56008
* gfortran.dg/realloc_on _assign_16.f90 : New test.

PR fortran/47517
* gfortran.dg/realloc_on _assign_17.f90 : New test.

From-SVN: r195741
gcc/fortran/ChangeLog
gcc/fortran/trans-array.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/realloc_on_assign_16.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/realloc_on_assign_17.f90 [new file with mode: 0644]