diff options
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); } |