summaryrefslogtreecommitdiff
path: root/gcc/fortran/trans-array.c
diff options
context:
space:
mode:
authorvehre <vehre@138bc75d-0d04-0410-961f-82ee72b054a4>2017-02-19 18:18:33 +0000
committervehre <vehre@138bc75d-0d04-0410-961f-82ee72b054a4>2017-02-19 18:18:33 +0000
commit62ab67868a91f0642690d809eaecb913ef117923 (patch)
treea39cc5e3a1fb427f0d6a210b901b623875d202de /gcc/fortran/trans-array.c
parent4488d9ee727ed4ea9b3c78e4b1c65e353937d884 (diff)
gcc/fortran/ChangeLog:
2017-02-19 Andre Vehreschild <vehre@gcc.gnu.org> PR fortran/79335 * trans-array.c (duplicate_allocatable_coarray): Ensure attributes passed are properly initialized. (structure_alloc_comps): Same. * trans-expr.c (gfc_trans_structure_assign): Same. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@245579 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/trans-array.c')
-rw-r--r--gcc/fortran/trans-array.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c
index d0dfc264f872..47e8c091a9b0 100644
--- a/gcc/fortran/trans-array.c
+++ b/gcc/fortran/trans-array.c
@@ -7950,6 +7950,8 @@ duplicate_allocatable_coarray (tree dest, tree dest_tok, tree src,
tree dummy_desc;
gfc_init_se (&se, NULL);
+ gfc_clear_attr (&attr);
+ attr.allocatable = 1;
dummy_desc = gfc_conv_scalar_to_descriptor (&se, dest, attr);
gfc_add_block_to_block (&globalblock, &se.pre);
size = TYPE_SIZE_UNIT (TREE_TYPE (type));
@@ -8518,14 +8520,15 @@ structure_alloc_comps (gfc_symbol * der_type, tree decl,
else
{
gfc_se se;
- symbol_attribute attr;
gfc_init_se (&se, NULL);
- gfc_clear_attr (&attr);
token = fold_build3_loc (input_location, COMPONENT_REF,
pvoid_type_node, decl, c->caf_token,
NULL_TREE);
- comp = gfc_conv_scalar_to_descriptor (&se, comp, attr);
+ comp = gfc_conv_scalar_to_descriptor (&se, comp,
+ c->ts.type == BT_CLASS
+ ? CLASS_DATA (c)->attr
+ : c->attr);
gfc_add_block_to_block (&fnblock, &se.pre);
}