https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92569
--- Comment #7 from Thomas Koenig <tkoenig at gcc dot gnu.org> --- (In reply to anlauf from comment #6) > Something like the following fixes the testcase, but leads to regressions > elsewhere in the testsuite (e.g. direct_io_{9,10}.f): You've found the right spot, I think. Index: io/transfer.c =================================================================== --- io/transfer.c (Revision 278025) +++ io/transfer.c (Arbeitskopie) @@ -2544,6 +2544,10 @@ while (data) { + if (unlikely (dtp->u.p.current_unit + && dtp->u.p.current_unit->endfile == AFTER_ENDFILE)) + return; + dtp->u.p.transfer (dtp, iotype, data, kind, size, tsize); data += stride0 * tsize; count[0] += tsize; seems to be better...