[Bug fortran/53521] [4.5/4.6/4.7/4.8 Regression] Zero-byte "memory leak" with zero-sized array constructor (valgrind warning)

Joost.VandeVondele at mat dot ethz.ch gcc-bugzilla@gcc.gnu.org
Wed May 30 14:38:00 GMT 2012


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

--- Comment #6 from Joost VandeVondele <Joost.VandeVondele at mat dot ethz.ch> 2012-05-30 14:37:09 UTC ---
(In reply to comment #4)
> You say not doing free (0) leaks memory?  What OS is this on?  

I'm observing on a Linux box that :

MODULE TEST
 IMPLICIT NONE
CONTAINS
 SUBROUTINE T(n1)
  INTEGER :: n1(:)
 END SUBROUTINE T
 SUBROUTINE T2(n)
   INTEGER :: n
   INTEGER :: k
   CALL T((/(k,k=1,n-1)/))
 END SUBROUTINE
END MODULE
USE TEST
  DO
    CALL T2(1)
  ENDDO
END 

needs 25Gb of memory after a while (notice the endless loop around CALL T2).



More information about the Gcc-bugs mailing list