This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/29752] [4.2/4.3 Regression] write(*,*,advance='NO'), READ(): Data not flushed



------- Comment #1 from burnus at gcc dot gnu dot org  2006-11-08 19:20 -------
CC: to jvdelisle@gcc.gnu.org, who is our libgfortran/io/ specialist.
Confirm bug.

I think the change is in transfer.c's finalize_transfer():
Change between 4.1 and 4.2/4.3 (incomplete diff, I might messed it up):

-      if (dtp->u.p.advance_status == ADVANCE_NO || dtp->u.p.seen_dollar)
-       {
-         /* Most systems buffer lines, so force the partial record
-            to be written out.  */
-         if (!is_internal_unit (dtp))
-           flush (dtp->u.p.current_unit->s);
-         dtp->u.p.seen_dollar = 0;
-         return;
-       }
+
+  if (dtp->u.p.advance_status == ADVANCE_NO)
+    return;
+

Here, a flush could be added, but I think having a flush before a read makes
more sense (cf. commercial compilers). (Do it in any read()? How expensive is a
flush of file where nothing is to be flushed?)


-- 

burnus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jvdelisle at gcc dot gnu dot
                   |                            |org
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2006-11-08 19:20:11
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29752


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]