diff options
author | Andre Vehreschild <vehre@gmx.de> | 2015-04-27 19:34:11 +0200 |
---|---|---|
committer | Andre Vehreschild <vehre@gcc.gnu.org> | 2015-04-27 19:34:11 +0200 |
commit | fc7d0afb9c70f466189c433962bab41a84765b0f (patch) | |
tree | 8a4260da5d8939c246372d739e6e13568877622d /gcc/fortran/trans-openmp.c | |
parent | 16d710b164529c81929bcb8bb55eea1b758b070e (diff) | |
download | gcc-fc7d0afb9c70f466189c433962bab41a84765b0f.zip gcc-fc7d0afb9c70f466189c433962bab41a84765b0f.tar.gz gcc-fc7d0afb9c70f466189c433962bab41a84765b0f.tar.bz2 |
re PR fortran/59678 ([F03] Segfault on equalizing variables of a complex derived type)
gcc/fortran
2015-04-27 Andre Vehreschild <vehre@gmx.de>
PR fortran/59678
PR fortran/65841
* trans-array.c (duplicate_allocatable): Fixed deep copy of
allocatable components, which are liable for copy only, when
they are allocated.
(gfc_duplicate_allocatable): Add deep-copy code into if
component allocated block. Needed interface change for that.
(gfc_copy_allocatable_data): Supplying NULL_TREE for code to
add into if-block for checking whether a component was
allocated.
(gfc_duplicate_allocatable_nocopy): Likewise.
(structure_alloc_comps): Likewise.
* trans-array.h: Likewise.
* trans-expr.c (gfc_trans_alloc_subarray_assign): Likewise.
* trans-openmp.c (gfc_walk_alloc_comps): Likewise.
gcc/testsuite
2015-04-27 Andre Vehreschild <vehre@gmx.de>
PR fortran/59678
PR fortran/65841
* gfortran.dg/alloc_comp_deep_copy_1.f03: New test.
* gfortran.dg/alloc_comp_deep_copy_2.f03: New test.
From-SVN: r222477
Diffstat (limited to 'gcc/fortran/trans-openmp.c')
-rw-r--r-- | gcc/fortran/trans-openmp.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/fortran/trans-openmp.c b/gcc/fortran/trans-openmp.c index 9642a7d..dd19a9c 100644 --- a/gcc/fortran/trans-openmp.c +++ b/gcc/fortran/trans-openmp.c @@ -391,9 +391,11 @@ gfc_walk_alloc_comps (tree decl, tree dest, tree var, if (GFC_DESCRIPTOR_TYPE_P (ftype) && GFC_TYPE_ARRAY_AKIND (ftype) == GFC_ARRAY_ALLOCATABLE) tem = gfc_duplicate_allocatable (destf, declf, ftype, - GFC_TYPE_ARRAY_RANK (ftype)); + GFC_TYPE_ARRAY_RANK (ftype), + NULL_TREE); else if (GFC_DECL_GET_SCALAR_ALLOCATABLE (field)) - tem = gfc_duplicate_allocatable (destf, declf, ftype, 0); + tem = gfc_duplicate_allocatable (destf, declf, ftype, 0, + NULL_TREE); break; } if (tem) |