https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81937
--- Comment #5 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> --- Author: jvdelisle Date: Sat Dec 16 21:57:17 2017 New Revision: 255752 URL: https://gcc.gnu.org/viewcvs?rev=255752&root=gcc&view=rev Log: 2017-12-16 Jerry DeLisle <jvdeli...@gcc.gnu.org> Backport from trunk PR libgfortran/81937 * io/list_read.c (next_char_internal): Don't attempt to read from the internal unit stream if no bytes are left. Decrement bytes_left in the right place. Modified: branches/gcc-7-branch/libgfortran/ChangeLog branches/gcc-7-branch/libgfortran/io/list_read.c