https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88411
--- Comment #4 from Thomas Koenig <tkoenig at gcc dot gnu.org> --- The problem appears to be that the record length is set to zero a file with the same unit number is opened again. Hmm... some more digging is needed.