http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58433
janus at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED CC| |janus at gcc dot gnu.org Resolution|--- |INVALID --- Comment #1 from janus at gcc dot gnu.org --- (In reply to Valery Weber from comment #0) > I get memory leaks with the FINAL for the following code and > gcc version 4.9.0 20130916 (experimental) (GCC). > Is that a bug? No, in fact this is not a bug. According to the Fortran standard, variables in the main program are not subject to automatic deallocation or finalization, cf. also PR 55207. If you put the variable 'a' inside a FUNCTION, SUBROUTINE or BLOCK, it will be finalized, but not in the main program.