https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80727
--- Comment #4 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> --- Author: jvdelisle Date: Wed May 17 20:00:53 2017 New Revision: 248167 URL: https://gcc.gnu.org/viewcvs?rev=248167&root=gcc&view=rev Log: 2017-05-17 Jerry DeLisle <jvdeli...@gcc.gnu.org> Backport from trunk PR libgfortran/80727 * transfer.c (read_sf_internal): Remove bogus code to detect EOR. (read_block_form): For internal units, generate EOR if no more bytes left in unit and we are trying to read with ADVANCE='NO'. * gfortran.dg/read_3.f90: New test. Added: branches/gcc-7-branch/gcc/testsuite/gfortran.dg/read_3.f90 Modified: branches/gcc-7-branch/gcc/testsuite/ChangeLog branches/gcc-7-branch/libgfortran/ChangeLog branches/gcc-7-branch/libgfortran/io/transfer.c