http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58434
Bug ID: 58434 Summary: no automatic deallocation with trunk 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 noticed a changed of behavior between 4.8.1 and trunk. While the following code produde no memory leaks with 4.8.1 it does with the trunk. Is that a bug? v cat tmp.f90 module mod type t integer,allocatable,dimension(:)::i end type t 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 ==13501== Memcheck, a memory error detector ==13501== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al. ==13501== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info ==13501== Command: ./a.out ==13501== ==13501== ==13501== HEAP SUMMARY: ==13501== in use at exit: 40,000 bytes in 1 blocks ==13501== total heap usage: 18 allocs, 17 frees, 43,688 bytes allocated ==13501== ==13501== LEAK SUMMARY: ==13501== definitely lost: 0 bytes in 0 blocks ==13501== indirectly lost: 0 bytes in 0 blocks ==13501== possibly lost: 0 bytes in 0 blocks ==13501== still reachable: 40,000 bytes in 1 blocks ==13501== suppressed: 0 bytes in 0 blocks ==13501== Rerun with --leak-check=full to see details of leaked memory ==13501== ==13501== For counts of detected and suppressed errors, rerun with: -v ==13501== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 2 from 2) gfortran-4.8.1 -g tmp.f90 valgrind ./a.out ==13508== Memcheck, a memory error detector ==13508== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al. ==13508== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info ==13508== Command: ./a.out ==13508== ==13508== ==13508== HEAP SUMMARY: ==13508== in use at exit: 0 bytes in 0 blocks ==13508== total heap usage: 18 allocs, 18 frees, 43,664 bytes allocated ==13508== ==13508== All heap blocks were freed -- no leaks are possible ==13508== ==13508== For counts of detected and suppressed errors, rerun with: -v ==13508== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 2 from 2)