https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107031

--- Comment #9 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> ---
The following trivial patch changes gfortran behavior and regression tests Ok
on x86_64.

I will see if I can come up with a test case to catch this.

diff --git a/libgfortran/io/file_pos.c b/libgfortran/io/file_pos.c
index 2bc05b293f8..d169961f997 100644
--- a/libgfortran/io/file_pos.c
+++ b/libgfortran/io/file_pos.c
@@ -352,7 +352,6 @@ st_endfile (st_parameter_filepos *fpp)
          dtp.common = fpp->common;
          memset (&dtp.u.p, 0, sizeof (dtp.u.p));
          dtp.u.p.current_unit = u;
-         next_record (&dtp, 1);
        }

       unit_truncate (u, stell (u->s), &fpp->common);

Reply via email to