From b945f9f35e60d2dee6d208eb87198b6d11bde9e5 Mon Sep 17 00:00:00 2001 From: Paul Thomas Date: Sun, 23 Nov 2008 21:34:44 +0000 Subject: re PR fortran/37735 (Allocatable components in vectors of derived types cause ICE on assignment) 2008-11-23 Paul Thomas PR fortran/37735 * trans-array.c (structure_alloc_comps): Do not duplicate the descriptor if this is a descriptorless array! 2008-11-23 Paul Thomas PR fortran/37735 * gfortran.dg/alloc_comp_assign_7.f90: New test. From-SVN: r142142 --- gcc/fortran/ChangeLog | 6 ++++++ gcc/fortran/trans-array.c | 10 ++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) (limited to 'gcc/fortran') diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 46cec41..4455365 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2008-11-23 Paul Thomas + + PR fortran/37735 + * trans-array.c (structure_alloc_comps): Do not duplicate the + descriptor if this is a descriptorless array! + 2008-11-12 Tobias Burnus PR fortran/38160 diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c index 1385409..85e80c7 100644 --- a/gcc/fortran/trans-array.c +++ b/gcc/fortran/trans-array.c @@ -5546,10 +5546,12 @@ structure_alloc_comps (gfc_symbol * der_type, tree decl, if (purpose == COPY_ALLOC_COMP) { - tmp = gfc_duplicate_allocatable (dest, decl, TREE_TYPE(decl), rank); - gfc_add_expr_to_block (&fnblock, tmp); - - tmp = build_fold_indirect_ref (gfc_conv_descriptor_data_get (dest)); + if (GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (dest))) + { + tmp = gfc_duplicate_allocatable (dest, decl, TREE_TYPE(decl), rank); + gfc_add_expr_to_block (&fnblock, tmp); + } + tmp = build_fold_indirect_ref (gfc_conv_array_data (dest)); dref = gfc_build_array_ref (tmp, index, NULL); tmp = structure_alloc_comps (der_type, vref, dref, rank, purpose); } -- cgit v1.1