From 84b286d05cbdff85ad3b69c6ef9a0d454157ae3a Mon Sep 17 00:00:00 2001 From: Janus Weil Date: Thu, 21 Feb 2013 13:26:44 +0100 Subject: re PR fortran/56385 ([OOP] ICE with allocatable function result in a procedure-pointer component) 2013-02-21 Janus Weil PR fortran/56385 * trans-array.c (structure_alloc_comps): Handle procedure-pointer components with allocatable result. 2013-02-21 Janus Weil PR fortran/56385 * gfortran.dg/proc_ptr_comp_37.f90: New. From-SVN: r196202 --- gcc/fortran/trans-array.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'gcc/fortran/trans-array.c') diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c index ee2954e..75fed2f 100644 --- a/gcc/fortran/trans-array.c +++ b/gcc/fortran/trans-array.c @@ -7547,8 +7547,8 @@ structure_alloc_comps (gfc_symbol * der_type, tree decl, called_dealloc_with_status = false; gfc_init_block (&tmpblock); - if (c->attr.allocatable - && (c->attr.dimension || c->attr.codimension)) + if (c->attr.allocatable && (c->attr.dimension || c->attr.codimension) + && !c->attr.proc_pointer) { comp = fold_build3_loc (input_location, COMPONENT_REF, ctype, decl, cdecl, NULL_TREE); @@ -7730,7 +7730,8 @@ structure_alloc_comps (gfc_symbol * der_type, tree decl, continue; } - if (c->attr.allocatable && !cmp_has_alloc_comps) + if (c->attr.allocatable && !c->attr.proc_pointer + && !cmp_has_alloc_comps) { rank = c->as ? c->as->rank : 0; tmp = gfc_duplicate_allocatable (dcmp, comp, ctype, rank); -- cgit v1.1