------- Comment #1 from burnus at gcc dot gnu dot org 2010-07-14 17:32 ------- I think we agree that the code is invalid. But I also would prefer a message such as GCC 4.5 had: At line 4 of file aa.f90 (unit = 8, file = 'fort.8') Fortran runtime error: End of file
The commit causing this diagnostics regression is probably Rev. : for PR libfortran/44477, cf. http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=161021 Actually, I am expecting the following error message from data_transfer_init: + if (dtp->u.p.current_unit->flags.access == ACCESS_SEQUENTIAL) + if (dtp->u.p.current_unit->endfile == AFTER_ENDFILE) + { + generate_error (&dtp->common, LIBERROR_OPTION_CONFLICT, + "Sequential READ or WRITE not allowed after " + "EOF marker, possibly use REWIND or BACKSPACE"); However, (gdb) p dtp->u.p.current_unit->endfile $2 = NO_ENDFILE By the way, I think that check should be moved before the format checks. Another question is why is the file marked as FORMATTED? "READ (unit)" should be unformatted, shouldn't it? And the file has not been explicitly opened for formatted I/O. Or have I missed some I/O fine print? p dtp->u.p.current_unit->flags.form $3 = FORM_FORMATTED p dtp->common.flags $5 = 0 -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44934