aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/trans-decl.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/fortran/trans-decl.c')
-rw-r--r--gcc/fortran/trans-decl.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c
index 637376b..75a2160 100644
--- a/gcc/fortran/trans-decl.c
+++ b/gcc/fortran/trans-decl.c
@@ -3451,12 +3451,9 @@ init_intent_out_dt (gfc_symbol * proc_sym, gfc_wrapped_block * block)
&& !CLASS_DATA (f->sym)->attr.class_pointer
&& CLASS_DATA (f->sym)->ts.u.derived->attr.alloc_comp)
{
- tree decl = build_fold_indirect_ref_loc (input_location,
- f->sym->backend_decl);
- tmp = CLASS_DATA (f->sym)->backend_decl;
- tmp = fold_build3_loc (input_location, COMPONENT_REF,
- TREE_TYPE (tmp), decl, tmp, NULL_TREE);
- tmp = build_fold_indirect_ref_loc (input_location, tmp);
+ tmp = gfc_class_data_get (f->sym->backend_decl);
+ if (CLASS_DATA (f->sym)->as == NULL)
+ tmp = build_fold_indirect_ref_loc (input_location, tmp);
tmp = gfc_deallocate_alloc_comp (CLASS_DATA (f->sym)->ts.u.derived,
tmp,
CLASS_DATA (f->sym)->as ?