diff options
author | pault <pault@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-12-18 09:34:13 +0000 |
---|---|---|
committer | pault <pault@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-12-18 09:34:13 +0000 |
commit | 3d2337cf840cf30e33844ba5d2d9c32826d82171 (patch) | |
tree | 1b2e25c60d3d7bb04a7d724be4b7db3f4f541b17 /gcc/fortran/trans-array.c | |
parent | 3bd8520f0993a527fa71b235f26b6397552e1623 (diff) |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@231807 138bc75d-0d04-0410-961f-82ee72b054a4
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 6e24e2e954cd..71e04822075b 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); |