https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64654
kargl at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kargl at gcc dot gnu.org --- Comment #1 from kargl at gcc dot gnu.org --- Reduced testcase. subroutine s(n,a) implicit none integer :: n character(len=n) :: a print *, 's' entry s0() print *, 's0' end subroutine s program p implicit none call s0() end program p Workaround. Don't compile with -O0. All other optimiziation levels -O1, -O2, and -O3 with and without -fcheck=all compile and run for gfortran 5.0.