https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78881
--- Comment #9 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> --- Created attachment 41014 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41014&action=edit Preliminay Patch Here is a preliminary patch. I have spent a lot of time looking at the DTIO problem case as well as a non DTIO version. I am still encountering differences in behavior depending on the advance= and the pad= status used. I am not satisfied with the results yet, but this patch is better than before. I suspect we have uncovered some latent issues. I will attach a test case with he current problem area, which is not hitting an EOF with advance=yes and pad=yes with file I/O