Index: flang/runtime/io-error.cpp =================================================================== --- flang/runtime/io-error.cpp +++ flang/runtime/io-error.cpp @@ -23,7 +23,7 @@ ioStat_ = IostatEnd; } } else if (iostatOrErrno == IostatEor && (flags_ & hasEor)) { - if (!ioStat_ == IostatOk || ioStat_ < IostatEor) { + if (ioStat_ == IostatOk || ioStat_ < IostatEor) { ioStat_ = IostatEor; // least priority } } else if (iostatOrErrno != IostatOk) {