trans-array.c (gfc_array_deallocate): Remove wrapper.
authorAndre Vehreschild <vehre@gcc.gnu.org>
Fri, 9 Dec 2016 12:32:50 +0000 (13:32 +0100)
committerAndre Vehreschild <vehre@gcc.gnu.org>
Fri, 9 Dec 2016 12:32:50 +0000 (13:32 +0100)
commit39da58667d94ab210cb6918fb8f528aa6aabfbb2
tree1bda74174ae46af10d3138cf905d8b73784c27ab
parent32913637718983cf04b8225ee778d5e96ae71d7c
trans-array.c (gfc_array_deallocate): Remove wrapper.

gcc/fortran/ChangeLog:

2016-12-09  Andre Vehreschild  <vehre@gcc.gnu.org>

* trans-array.c (gfc_array_deallocate): Remove wrapper.
(gfc_trans_dealloc_allocated): Same.
(structure_alloc_comps): Restructure deallocation of (nested)
allocatable components.  Insert dealloc of sub-component into the block
guarded by the if != NULL for the component.
(gfc_trans_deferred_array): Use the almightly deallocate_with_status.
* trans-array.h: Remove prototypes.
* trans-expr.c (gfc_conv_procedure_call): Use the almighty deallocate_
with_status.
* trans-openmp.c (gfc_walk_alloc_comps): Likewise.
(gfc_omp_clause_assign_op): Likewise.
(gfc_omp_clause_dtor): Likewise.
* trans-stmt.c (gfc_trans_deallocate): Likewise.
* trans.c (gfc_deallocate_with_status): Allow deallocation of scalar
and arrays as well as coarrays.
(gfc_deallocate_scalar_with_status): Get the data member for coarrays
only when freeing an array with descriptor.  And set correct caf_mode
when freeing components of coarrays.
* trans.h: Change prototype of gfc_deallocate_with_status to allow
adding statements into the block guarded by the if (pointer != 0) and
supply a coarray handle.

gcc/testsuite/ChangeLog:

2016-12-09  Andre Vehreschild  <vehre@gcc.gnu.org>

* gfortran.dg/coarray_alloc_comp_3.f08: New test.
* gfortran.dg/coarray_alloc_comp_4.f08: New test.
* gfortran.dg/finalize_18.f90: Add count for additional guard against
accessing null-pointer.
* gfortran.dg/proc_ptr_comp_47.f90: New test.

From-SVN: r243480
13 files changed:
gcc/fortran/ChangeLog
gcc/fortran/trans-array.c
gcc/fortran/trans-array.h
gcc/fortran/trans-expr.c
gcc/fortran/trans-openmp.c
gcc/fortran/trans-stmt.c
gcc/fortran/trans.c
gcc/fortran/trans.h
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/coarray_alloc_comp_3.f08 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/coarray_alloc_comp_4.f08 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/finalize_18.f90
gcc/testsuite/gfortran.dg/proc_ptr_comp_47.f90 [new file with mode: 0644]