From 241e79cfc4264dec4eaf1e8af890da3527c99193 Mon Sep 17 00:00:00 2001 From: Tobias Burnus Date: Thu, 25 Aug 2011 17:59:40 +0200 Subject: trans-array.c (structure_alloc_comps): Fix for allocatable scalar coarray components. 2011-08-25 Tobias Burnus * trans-array.c (structure_alloc_comps): Fix for allocatable scalar coarray components. * trans-expr.c (gfc_conv_component_ref): Ditto. * trans-type.c (gfc_get_derived_type): Ditto. 2011-08-25 Tobias Burnus * gfortran.dg/coarray/alloc_comp_1.f90: New. From-SVN: r178068 --- gcc/fortran/trans-array.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'gcc/fortran/trans-array.c') diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c index 3a75658..bd9e88e 100644 --- a/gcc/fortran/trans-array.c +++ b/gcc/fortran/trans-array.c @@ -6798,7 +6798,8 @@ structure_alloc_comps (gfc_symbol * der_type, tree decl, gfc_add_expr_to_block (&fnblock, tmp); } - if (c->attr.allocatable && c->attr.dimension) + if (c->attr.allocatable + && (c->attr.dimension || c->attr.codimension)) { comp = fold_build3_loc (input_location, COMPONENT_REF, ctype, decl, cdecl, NULL_TREE); @@ -6845,7 +6846,8 @@ structure_alloc_comps (gfc_symbol * der_type, tree decl, case NULLIFY_ALLOC_COMP: if (c->attr.pointer) continue; - else if (c->attr.allocatable && c->attr.dimension) + else if (c->attr.allocatable + && (c->attr.dimension|| c->attr.codimension)) { comp = fold_build3_loc (input_location, COMPONENT_REF, ctype, decl, cdecl, NULL_TREE); -- cgit v1.1