https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85192
Thomas Koenig <tkoenig at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |WAITING Last reconfirmed| |2018-04-04 CC| |tkoenig at gcc dot gnu.org Ever confirmed|0 |1 --- Comment #1 from Thomas Koenig <tkoenig at gcc dot gnu.org> --- Works for me with current trunk and with gcc 7: ig25@flaemmli:~/Krempel/Leak> gfortran b.f90 meminfo.c && ./a.out 3312 3408 3504 3600 3696 3792 3888 3888 3888 3888 ig25@flaemmli:~/Krempel/Leak> /usr/bin/gfortran-7 b.f90 meminfo.c && ./a.out 3296 3392 3488 3584 3680 3776 3872 3872 3872 3872 Also, valgrind disagrees (on a slightly reduced test case): ig25@flaemmli:~/Krempel/Leak> cat a.f90 ! PR 85192 real*8 x, y, z, u, v, w, erg, tme, wgt character*250 line line='1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10' ! nstart = meminfo() do i=1,10 read(line,*) x,y,z,u,v,w,erg,tme,wgt,ij ! print *, x,y,z,u,v,w,erg,tme,wgt,ij ! print *,meminfo()-nstart enddo end ig25@flaemmli:~/Krempel/Leak> gfortran a.f90 ig25@flaemmli:~/Krempel/Leak> valgrind ./a.out ==4343== Memcheck, a memory error detector ==4343== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. ==4343== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info ==4343== Command: ./a.out ==4343== ==4343== ==4343== HEAP SUMMARY: ==4343== in use at exit: 0 bytes in 0 blocks ==4343== total heap usage: 153 allocs, 153 frees, 46,760 bytes allocated ==4343== ==4343== All heap blocks were freed -- no leaks are possible ==4343== ==4343== For counts of detected and suppressed errors, rerun with: -v ==4343== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) What version are you using?