It seems that the io library is leaking memory when reading logicals, as demonstrated by the small program below; when running, the program uses more and more memory until it's killed. I don't see this behaviour with data types other than logicals.
erik:/var/tmp$ cat memoryleak.f90 program memoryleak implicit none logical :: foo integer :: ios ios = 0 do while (ios == 0) read (*, *, iostat=ios) foo end do end program memoryleak erik:/var/tmp$ gfortran memoryleak.f90 erik:/var/tmp$ awk 'BEGIN{while (1) print "F"}' | a.out Killed -- Summary: Memory leaks when reading logicals Product: gcc Version: 4.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libfortran AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: eedelman at gcc dot gnu dot org GCC host triplet: i686-pc-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27360