http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58433

            Bug ID: 58433
           Summary: FINAL memory leaks
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: valeryweber at hotmail dot com

Dear All

I get memory leaks with the FINAL for the following code and
gcc version 4.9.0 20130916 (experimental) (GCC).
Is that a bug?
V


cat tmp.f90
module mod
  type t
     integer,allocatable,dimension(:)::i
   contains
     final :: t_final
  end type t
contains
  subroutine t_final(a)
    type(t) :: a
    deallocate(a%i)
  end subroutine t_final
end module mod
program main
  use mod
  type(t) :: a
  allocate(a%i(10000))
end program main
gfortran-trunk -g tmp.f90
valgrind ./a.out 
==13378== Memcheck, a memory error detector
==13378== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al.
==13378== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info
==13378== Command: ./a.out
==13378== 
==13378== 
==13378== HEAP SUMMARY:
==13378==     in use at exit: 40,000 bytes in 1 blocks
==13378==   total heap usage: 18 allocs, 17 frees, 43,688 bytes allocated
==13378== 
==13378== LEAK SUMMARY:
==13378==    definitely lost: 0 bytes in 0 blocks
==13378==    indirectly lost: 0 bytes in 0 blocks
==13378==      possibly lost: 0 bytes in 0 blocks
==13378==    still reachable: 40,000 bytes in 1 blocks
==13378==         suppressed: 0 bytes in 0 blocks
==13378== Rerun with --leak-check=full to see details of leaked memory
==13378== 
==13378== For counts of detected and suppressed errors, rerun with: -v
==13378== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 2 from 2)

Reply via email to