2015-01-23 Janus Weil <janus@gcc.gnu.org>
PR fortran/60922
* class.c (finalize_component): Apply the check for 'fini_coarray' only
to coarray components.
2015-01-23 Janus Weil <janus@gcc.gnu.org>
PR fortran/60922
* gfortran.dg/class_allocate_17.f90: New.
From-SVN: r220029
+2015-01-23 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/60922
+ * class.c (finalize_component): Apply the check for 'fini_coarray' only
+ to coarray components.
+
2015-01-23 Tobias Burnus <burnus@net-b.de>
PR fortran/64726
/* Add IF (fini_coarray). */
if (comp->attr.codimension
|| (comp->ts.type == BT_CLASS && CLASS_DATA (comp)
- && CLASS_DATA (comp)->attr.allocatable))
+ && CLASS_DATA (comp)->attr.codimension))
{
block = gfc_get_code (EXEC_IF);
if (*code)
+2015-01-23 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/60922
+ * gfortran.dg/class_allocate_17.f90: New.
+
2015-01-23 Tobias Burnus <burnus@net-b.de>
PR fortran/64726
--- /dev/null
+! { dg-do compile }
+! { dg-options "-fdump-tree-original" }
+!
+! PR 60922: [4.9/5 regression] Memory leak with allocatable CLASS components
+!
+! Contributed by Salvatore Filippone <sfilippone@uniroma2.it>
+
+program test_leak
+ implicit none
+
+ type d_base_vect_type
+ end type
+
+ type d_vect_type
+ class(d_base_vect_type), allocatable :: v
+ end type
+
+ call test()
+
+contains
+
+ subroutine test()
+ class(d_vect_type), allocatable :: x
+ allocate(x)
+ allocate(x%v)
+ print *,"allocated!"
+ end subroutine
+
+end
+
+! { dg-final { scan-tree-dump-times "fini_coarray" 1 "original" } }
+! { dg-final { cleanup-tree-dump "original" } }