diff options
author | Paul Thomas <pault@gcc.gnu.org> | 2008-11-23 21:34:44 +0000 |
---|---|---|
committer | Paul Thomas <pault@gcc.gnu.org> | 2008-11-23 21:34:44 +0000 |
commit | b945f9f35e60d2dee6d208eb87198b6d11bde9e5 (patch) | |
tree | 1925b52e77adf9675418ef5786bf894b8c6ab7c6 /gcc/fortran/trans-array.c | |
parent | 74e6a47563f8aa912cb0915e8fe9142cd84ac503 (diff) | |
download | gcc-b945f9f35e60d2dee6d208eb87198b6d11bde9e5.zip gcc-b945f9f35e60d2dee6d208eb87198b6d11bde9e5.tar.gz gcc-b945f9f35e60d2dee6d208eb87198b6d11bde9e5.tar.bz2 |
re PR fortran/37735 (Allocatable components in vectors of derived types cause ICE on assignment)
2008-11-23 Paul Thomas <pault@gcc.gnu.org>
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 <pault@gcc.gnu.org>
PR fortran/37735
* gfortran.dg/alloc_comp_assign_7.f90: New test.
From-SVN: r142142
Diffstat (limited to 'gcc/fortran/trans-array.c')
-rw-r--r-- | gcc/fortran/trans-array.c | 10 |
1 files changed, 6 insertions, 4 deletions
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); } |