diff options
author | Paul Thomas <pault@gcc.gnu.org> | 2015-12-18 09:34:13 +0000 |
---|---|---|
committer | Paul Thomas <pault@gcc.gnu.org> | 2015-12-18 09:34:13 +0000 |
commit | 332477628507525e3f252183a864d74bddb5c77f (patch) | |
tree | 1b2e25c60d3d7bb04a7d724be4b7db3f4f541b17 /gcc/fortran/trans-array.c | |
parent | 6638efce562e68d702d859c124ed36c7a8c55556 (diff) | |
download | gcc-332477628507525e3f252183a864d74bddb5c77f.zip gcc-332477628507525e3f252183a864d74bddb5c77f.tar.gz gcc-332477628507525e3f252183a864d74bddb5c77f.tar.bz2 |
re PR fortran/68196 (ICE on function result with procedure pointer component)
2015-12-18 Paul Thomas <pault@gcc.gnu.org>
PR fortran/68196
*expr.c (gfc_has_default_initializer): Prevent infinite recursion
through this function for procedure pointer components.
* trans-array.c (structure_alloc_comps): Ditto twice.
2015-12-18 Paul Thomas <pault@gcc.gnu.org>
PR fortran/68196
* gfortran.dg/proc_ptr_48.f90: New test.
From-SVN: r231807
Diffstat (limited to 'gcc/fortran/trans-array.c')
-rw-r--r-- | gcc/fortran/trans-array.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c index 6e24e2e..71e0482 100644 --- a/gcc/fortran/trans-array.c +++ b/gcc/fortran/trans-array.c @@ -8074,7 +8074,7 @@ structure_alloc_comps (gfc_symbol * der_type, tree decl, } if (cmp_has_alloc_comps - && !c->attr.pointer + && !c->attr.pointer && !c->attr.proc_pointer && !called_dealloc_with_status) { /* Do not deallocate the components of ultimate pointer @@ -8264,7 +8264,8 @@ structure_alloc_comps (gfc_symbol * der_type, tree decl, components that are really allocated, the deep copy code has to be generated first and then added to the if-block in gfc_duplicate_allocatable (). */ - if (cmp_has_alloc_comps) + if (cmp_has_alloc_comps + && !c->attr.proc_pointer) { rank = c->as ? c->as->rank : 0; tmp = fold_convert (TREE_TYPE (dcmp), comp); |