https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59513
--- Comment #20 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> --- I think gfortran behavior is correct. The problem with the sample code is in the lack of handling in subroutine BOTTOM. The loop is reading past the end of the file. END= is not a true error condition, but a file condition. One can not just ignore it, the read has gone past the End-Of-File marker. It is necessary to position the file. Also, this is really not good coding practice to do nothing on ERR=. ERR= really is an ERROR. SUBROUTINE BOTTOM(LU) CHARACTER*1 DUMMY 10 READ(LU,1000,END=90,ERR=90) DUMMY 1000 FORMAT(A) GO TO 10 90 BACKSPACE(LU) RETURN END Fortran 2003 Standard: 9.2.3.2 File position prior to data transfer If the file contains an endfile record, the file shall not be positioned after the endfile record prior to data transfer. However, a REWIND or BACKSPACE statement may be used to reposition the file. Based on this I believe the resolution of this bug is 'INVALID'. The bug is in xfoil. We could choose to disable the error on -std=legacy. I do not know what the old g77 did. I will check that.