public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libfortran/33985]  New: access="stream",form="unformatted" doesn't buffer
@ 2007-11-02 22:18 tkoenig at gcc dot gnu dot org
  2007-11-02 22:43 ` [Bug libfortran/33985] " fxcoudert at gcc dot gnu dot org
                   ` (34 more replies)
  0 siblings, 35 replies; 37+ messages in thread
From: tkoenig at gcc dot gnu dot org @ 2007-11-02 22:18 UTC (permalink / raw)
  To: gcc-bugs

Reduced test case from

http://gcc.gnu.org/ml/fortran/2007-10/msg00412.html

$ cat write.f90 
program main
  implicit none
  integer :: i
  open(95,form="unformatted",access="stream")
  do i=0,255
    write(95) int(i,kind=1)
  end do
end program main
$ gfortran write.f90 
$ strace -etrace=write ./a.out
write(3, "\0", 1)                       = 1
write(3, "\1", 1)                       = 1
write(3, "\2", 1)                       = 1
write(3, "\3", 1)                       = 1
write(3, "\4", 1)                       = 1
write(3, "\5", 1)                       = 1
write(3, "\6", 1)                       = 1
write(3, "\7", 1)                       = 1
write(3, "\10", 1)                      = 1
write(3, "\t", 1)                       = 1
write(3, "\n", 1)                       = 1
write(3, "\v", 1)                       = 1
write(3, "\f", 1)                       = 1
write(3, "\r", 1)                       = 1
write(3, "\16", 1)                      = 1
write(3, "\17", 1)                      = 1
write(3, "\20", 1)                      = 1
write(3, "\21", 1)                      = 1
write(3, "\22", 1)                      = 1
write(3, "\23", 1)                      = 1
write(3, "\24", 1)                      = 1
write(3, "\25", 1)                      = 1
write(3, "\26", 1)                      = 1
write(3, "\27", 1)                      = 1
write(3, "\30", 1)                      = 1
write(3, "\31", 1)                      = 1
write(3, "\32", 1)                      = 1
write(3, "\33", 1)                      = 1
write(3, "\34", 1)                      = 1

... and so on.


-- 
           Summary: access="stream",form="unformatted" doesn't buffer
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libfortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: tkoenig at gcc dot gnu dot org


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


^ permalink raw reply	[flat|nested] 37+ messages in thread

* [Bug libfortran/33985] access="stream",form="unformatted" doesn't buffer
  2007-11-02 22:18 [Bug libfortran/33985] New: access="stream",form="unformatted" doesn't buffer tkoenig at gcc dot gnu dot org
@ 2007-11-02 22:43 ` fxcoudert at gcc dot gnu dot org
  2007-11-03  0:42 ` jvdelisle at gcc dot gnu dot org
                   ` (33 subsequent siblings)
  34 siblings, 0 replies; 37+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2007-11-02 22:43 UTC (permalink / raw)
  To: gcc-bugs



-- 

fxcoudert at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |enhancement
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2007-11-02 22:43:14
               date|                            |


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


^ permalink raw reply	[flat|nested] 37+ messages in thread

* [Bug libfortran/33985] access="stream",form="unformatted" doesn't buffer
  2007-11-02 22:18 [Bug libfortran/33985] New: access="stream",form="unformatted" doesn't buffer tkoenig at gcc dot gnu dot org
  2007-11-02 22:43 ` [Bug libfortran/33985] " fxcoudert at gcc dot gnu dot org
@ 2007-11-03  0:42 ` jvdelisle at gcc dot gnu dot org
  2007-11-03  1:18 ` jvdelisle at gcc dot gnu dot org
                   ` (32 subsequent siblings)
  34 siblings, 0 replies; 37+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2007-11-03  0:42 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from jvdelisle at gcc dot gnu dot org  2007-11-03 00:42 -------
Created an attachment (id=14476)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14476&action=view)
-fdump-tree-original output

This is an optimization issue in the front-end.  We have to be smart enough to
lift the st_write_done out of the loop.  A different example of this is
PR32382.


-- 


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


^ permalink raw reply	[flat|nested] 37+ messages in thread

* [Bug libfortran/33985] access="stream",form="unformatted" doesn't buffer
  2007-11-02 22:18 [Bug libfortran/33985] New: access="stream",form="unformatted" doesn't buffer tkoenig at gcc dot gnu dot org
  2007-11-02 22:43 ` [Bug libfortran/33985] " fxcoudert at gcc dot gnu dot org
  2007-11-03  0:42 ` jvdelisle at gcc dot gnu dot org
@ 2007-11-03  1:18 ` jvdelisle at gcc dot gnu dot org
  2007-11-03 14:57 ` jvdelisle at gcc dot gnu dot org
                   ` (31 subsequent siblings)
  34 siblings, 0 replies; 37+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2007-11-03  1:18 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from jvdelisle at gcc dot gnu dot org  2007-11-03 01:17 -------
I have discovered something that may make this easy to fix.


-- 

jvdelisle at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |jvdelisle at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2007-11-02 22:43:14         |2007-11-03 01:17:50
               date|                            |


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


^ permalink raw reply	[flat|nested] 37+ messages in thread

* [Bug libfortran/33985] access="stream",form="unformatted" doesn't buffer
  2007-11-02 22:18 [Bug libfortran/33985] New: access="stream",form="unformatted" doesn't buffer tkoenig at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2007-11-03  1:18 ` jvdelisle at gcc dot gnu dot org
@ 2007-11-03 14:57 ` jvdelisle at gcc dot gnu dot org
  2007-11-03 15:06 ` jvdelisle at gcc dot gnu dot org
                   ` (30 subsequent siblings)
  34 siblings, 0 replies; 37+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2007-11-03 14:57 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from jvdelisle at gcc dot gnu dot org  2007-11-03 14:57 -------
Subject: Bug 33985

Author: jvdelisle
Date: Sat Nov  3 14:57:13 2007
New Revision: 129870

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=129870
Log:
2007-11-03  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

        PR libfortran/33985
        * io/transfer.c (finalize_transfer): Do not flush for
        unformatted STREAM I/O.

Modified:
    trunk/libgfortran/ChangeLog
    trunk/libgfortran/io/transfer.c


-- 


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


^ permalink raw reply	[flat|nested] 37+ messages in thread

* [Bug libfortran/33985] access="stream",form="unformatted" doesn't buffer
  2007-11-02 22:18 [Bug libfortran/33985] New: access="stream",form="unformatted" doesn't buffer tkoenig at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2007-11-03 14:57 ` jvdelisle at gcc dot gnu dot org
@ 2007-11-03 15:06 ` jvdelisle at gcc dot gnu dot org
  2007-11-06  2:41 ` jvdelisle at gcc dot gnu dot org
                   ` (29 subsequent siblings)
  34 siblings, 0 replies; 37+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2007-11-03 15:06 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from jvdelisle at gcc dot gnu dot org  2007-11-03 15:06 -------
Fixed on Trunk.  Thomas if you think we should do more, please reopen.


-- 

jvdelisle at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


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


^ permalink raw reply	[flat|nested] 37+ messages in thread

* [Bug libfortran/33985] access="stream",form="unformatted" doesn't buffer
  2007-11-02 22:18 [Bug libfortran/33985] New: access="stream",form="unformatted" doesn't buffer tkoenig at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2007-11-03 15:06 ` jvdelisle at gcc dot gnu dot org
@ 2007-11-06  2:41 ` jvdelisle at gcc dot gnu dot org
  2007-11-06 16:17 ` dominiq at lps dot ens dot fr
                   ` (28 subsequent siblings)
  34 siblings, 0 replies; 37+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2007-11-06  2:41 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from jvdelisle at gcc dot gnu dot org  2007-11-06 02:41 -------
Here is a test case that fails with the new patch. (Thanks Dominique)

program streamtest
  implicit none
  character(1)   :: lf = char(10)
  character(1)   :: tchar
  integer        :: i,j,k
  real(kind=4), dimension(100,100) :: anarray
  open(10, file="teststream", access="stream", form="unformatted")
  anarray = 3.14159
  write(10) anarray
  write(10, pos=1) ! This is a way to position an unformatted file
  anarray = 0.0
  read(10) anarray
  anarray = abs(anarray - 3.14159)
  if (any(anarray.gt.0.00001)) call abort()
  close(10,status="delete")
end program streamtest

Ans a simple patch to fix it:

Index: io/transfer.c
===================================================================
--- io/transfer.c       (revision 129871)
+++ io/transfer.c       (working copy)
@@ -591,11 +591,14 @@ write_buf (st_parameter_dt *dtp, void *b
   size_t have_written, to_write_subrecord;
   int short_record;

-
   /* Stream I/O.  */

   if (is_stream_io (dtp))
     {
+      if (dtp->u.p.current_unit->strm_pos - 1
+         < file_position (dtp->u.p.current_unit->s))
+       flush(dtp->u.p.current_unit->s);
+      
       if (sseek (dtp->u.p.current_unit->s,
                 dtp->u.p.current_unit->strm_pos - 1) == FAILURE)
        {

Regression tested on x86-64-linux-gnu


-- 

jvdelisle at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |


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


^ permalink raw reply	[flat|nested] 37+ messages in thread

* [Bug libfortran/33985] access="stream",form="unformatted" doesn't buffer
  2007-11-02 22:18 [Bug libfortran/33985] New: access="stream",form="unformatted" doesn't buffer tkoenig at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2007-11-06  2:41 ` jvdelisle at gcc dot gnu dot org
@ 2007-11-06 16:17 ` dominiq at lps dot ens dot fr
  2007-11-06 23:39 ` jvdelisle at gcc dot gnu dot org
                   ` (27 subsequent siblings)
  34 siblings, 0 replies; 37+ messages in thread
From: dominiq at lps dot ens dot fr @ 2007-11-06 16:17 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from dominiq at lps dot ens dot fr  2007-11-06 16:17 -------
> Ans a simple patch to fix it:

I have applied the patch, but the test case fails if teststream does not exist
(passes if the file exists).

[karma] f90/bug% gfc streamtest_7.f90
[karma] f90/bug% a.out 
[karma] f90/bug% a.out
At line 15 of file streamtest_7.f90 (unit = 10, file = 'teststream')
Fortran runtime error: End of file
[karma] f90/bug% a.out
[karma] f90/bug% a.out
At line 15 of file streamtest_7.f90 (unit = 10, file = 'teststream')
Fortran runtime error: End of file
[karma] f90/bug% rm teststream
remove teststream? y
[karma] f90/bug% rm teststream
rm: teststream: No such file or directory
[karma] f90/bug% a.out
At line 15 of file streamtest_7.f90 (unit = 10, file = 'teststream')
Fortran runtime error: End of file
[karma] f90/bug% rm teststream
remove teststream? y
[karma] f90/bug% a.out
At line 15 of file streamtest_7.f90 (unit = 10, file = 'teststream')
Fortran runtime error: End of file

Since I did not do this test without the patch, I cannot say if this is due to
the patch or if it was there before it.


-- 


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


^ permalink raw reply	[flat|nested] 37+ messages in thread

* [Bug libfortran/33985] access="stream",form="unformatted" doesn't buffer
  2007-11-02 22:18 [Bug libfortran/33985] New: access="stream",form="unformatted" doesn't buffer tkoenig at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2007-11-06 16:17 ` dominiq at lps dot ens dot fr
@ 2007-11-06 23:39 ` jvdelisle at gcc dot gnu dot org
  2007-11-07  2:44 ` jvdelisle at gcc dot gnu dot org
                   ` (26 subsequent siblings)
  34 siblings, 0 replies; 37+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2007-11-06 23:39 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from jvdelisle at gcc dot gnu dot org  2007-11-06 23:39 -------
All the more reason to take our time with this.  Thanks for the testing.


-- 


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


^ permalink raw reply	[flat|nested] 37+ messages in thread

* [Bug libfortran/33985] access="stream",form="unformatted" doesn't buffer
  2007-11-02 22:18 [Bug libfortran/33985] New: access="stream",form="unformatted" doesn't buffer tkoenig at gcc dot gnu dot org
                   ` (7 preceding siblings ...)
  2007-11-06 23:39 ` jvdelisle at gcc dot gnu dot org
@ 2007-11-07  2:44 ` jvdelisle at gcc dot gnu dot org
  2007-11-14  1:22 ` jvdelisle at gcc dot gnu dot org
                   ` (25 subsequent siblings)
  34 siblings, 0 replies; 37+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2007-11-07  2:44 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from jvdelisle at gcc dot gnu dot org  2007-11-07 02:43 -------
Subject: Bug 33985

Author: jvdelisle
Date: Wed Nov  7 02:43:44 2007
New Revision: 129955

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=129955
Log:
2007-11-06  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

        PR libfortran/33985
        * io/transfer.c (finalize_transfer): Revert previous patch.

Modified:
    trunk/libgfortran/ChangeLog
    trunk/libgfortran/io/transfer.c


-- 


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


^ permalink raw reply	[flat|nested] 37+ messages in thread

* [Bug libfortran/33985] access="stream",form="unformatted" doesn't buffer
  2007-11-02 22:18 [Bug libfortran/33985] New: access="stream",form="unformatted" doesn't buffer tkoenig at gcc dot gnu dot org
                   ` (8 preceding siblings ...)
  2007-11-07  2:44 ` jvdelisle at gcc dot gnu dot org
@ 2007-11-14  1:22 ` jvdelisle at gcc dot gnu dot org
  2007-11-30 22:28 ` tkoenig at gcc dot gnu dot org
                   ` (24 subsequent siblings)
  34 siblings, 0 replies; 37+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2007-11-14  1:22 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from jvdelisle at gcc dot gnu dot org  2007-11-14 01:22 -------
Subject: Bug 33985

Author: jvdelisle
Date: Wed Nov 14 01:22:17 2007
New Revision: 130172

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=130172
Log:
2007-11-13  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

        PR fortran/33985
        *gfortran.dg/streamio_12.f90: New test to avoid future regression.

Added:
    trunk/gcc/testsuite/gfortran.dg/streamio_12.f90
Modified:
    trunk/gcc/testsuite/ChangeLog


-- 


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


^ permalink raw reply	[flat|nested] 37+ messages in thread

* [Bug libfortran/33985] access="stream",form="unformatted" doesn't buffer
  2007-11-02 22:18 [Bug libfortran/33985] New: access="stream",form="unformatted" doesn't buffer tkoenig at gcc dot gnu dot org
                   ` (9 preceding siblings ...)
  2007-11-14  1:22 ` jvdelisle at gcc dot gnu dot org
@ 2007-11-30 22:28 ` tkoenig at gcc dot gnu dot org
  2007-11-30 22:45 ` jvdelisle at gcc dot gnu dot org
                   ` (23 subsequent siblings)
  34 siblings, 0 replies; 37+ messages in thread
From: tkoenig at gcc dot gnu dot org @ 2007-11-30 22:28 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from tkoenig at gcc dot gnu dot org  2007-11-30 22:27 -------
Created an attachment (id=14675)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14675&action=view)
proposed patch

Hi Jerry,

could you look at this?  This also fixes excessive seeking
when writing, but this is deep regression country
(backspace_5.f, backspace_6.f and streamio_12.f90
are candidates for failure here :-) and the more people
look at this, the better.


-- 


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


^ permalink raw reply	[flat|nested] 37+ messages in thread

* [Bug libfortran/33985] access="stream",form="unformatted" doesn't buffer
  2007-11-02 22:18 [Bug libfortran/33985] New: access="stream",form="unformatted" doesn't buffer tkoenig at gcc dot gnu dot org
                   ` (10 preceding siblings ...)
  2007-11-30 22:28 ` tkoenig at gcc dot gnu dot org
@ 2007-11-30 22:45 ` jvdelisle at gcc dot gnu dot org
  2007-11-30 22:57 ` tkoenig at gcc dot gnu dot org
                   ` (22 subsequent siblings)
  34 siblings, 0 replies; 37+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2007-11-30 22:45 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from jvdelisle at gcc dot gnu dot org  2007-11-30 22:45 -------
Thanks,

I will look this over.  I was saving this for when I really had some time.  We
need to test it with everything we can find.  I am glad you are as sensitive to
the potential regression issue as I am.  :)


-- 


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


^ permalink raw reply	[flat|nested] 37+ messages in thread

* [Bug libfortran/33985] access="stream",form="unformatted" doesn't buffer
  2007-11-02 22:18 [Bug libfortran/33985] New: access="stream",form="unformatted" doesn't buffer tkoenig at gcc dot gnu dot org
                   ` (11 preceding siblings ...)
  2007-11-30 22:45 ` jvdelisle at gcc dot gnu dot org
@ 2007-11-30 22:57 ` tkoenig at gcc dot gnu dot org
  2007-11-30 23:55 ` jvdelisle at gcc dot gnu dot org
                   ` (21 subsequent siblings)
  34 siblings, 0 replies; 37+ messages in thread
From: tkoenig at gcc dot gnu dot org @ 2007-11-30 22:57 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #12 from tkoenig at gcc dot gnu dot org  2007-11-30 22:57 -------
(In reply to comment #11)
> Thanks,
> 
> I will look this over.  I was saving this for when I really had some time.  We
> need to test it with everything we can find.  I am glad you are as sensitive to
> the potential regression issue as I am.  :)

Actually, I just found that this doesn't really help a lot (too many
reads...).

I'll need to tweak this a bit.


-- 


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


^ permalink raw reply	[flat|nested] 37+ messages in thread

* [Bug libfortran/33985] access="stream",form="unformatted" doesn't buffer
  2007-11-02 22:18 [Bug libfortran/33985] New: access="stream",form="unformatted" doesn't buffer tkoenig at gcc dot gnu dot org
                   ` (12 preceding siblings ...)
  2007-11-30 22:57 ` tkoenig at gcc dot gnu dot org
@ 2007-11-30 23:55 ` jvdelisle at gcc dot gnu dot org
  2007-12-01  4:22 ` jvdelisle at gcc dot gnu dot org
                   ` (20 subsequent siblings)
  34 siblings, 0 replies; 37+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2007-11-30 23:55 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #13 from jvdelisle at gcc dot gnu dot org  2007-11-30 23:55 -------
Created an attachment (id=14676)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14676&action=view)
Another idea borrowing from Thomas

Thomas, This patch regression tests OK and passes streamio_12.f90, the original
that regressed on my first patch.  Just tinkering here a bit.  


-- 


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


^ permalink raw reply	[flat|nested] 37+ messages in thread

* [Bug libfortran/33985] access="stream",form="unformatted" doesn't buffer
  2007-11-02 22:18 [Bug libfortran/33985] New: access="stream",form="unformatted" doesn't buffer tkoenig at gcc dot gnu dot org
                   ` (13 preceding siblings ...)
  2007-11-30 23:55 ` jvdelisle at gcc dot gnu dot org
@ 2007-12-01  4:22 ` jvdelisle at gcc dot gnu dot org
  2007-12-01  4:28 ` howarth at nitro dot med dot uc dot edu
                   ` (19 subsequent siblings)
  34 siblings, 0 replies; 37+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2007-12-01  4:22 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #14 from jvdelisle at gcc dot gnu dot org  2007-12-01 04:22 -------
This is embarrassing and good at the same time:

Index: unix.c
===================================================================
--- unix.c      (revision 130547)
+++ unix.c      (working copy)

@@ -669,11 +669,8 @@ fd_seek (unix_stream * s, gfc_offset off
   if (s->file_length == -1)
     return SUCCESS;

-  if (s->physical_offset == offset) /* Are we lucky and avoid syscall?  */
-    {
-      s->logical_offset = offset;
-      return SUCCESS;
-    }
+  if (s->logical_offset == offset) /* Are we lucky and avoid syscall?  */
+    return SUCCESS;

   if (lseek (s->fd, offset, SEEK_SET) >= 0)
     {

According to the comment we have been unlucky for a long time.  :) With this
simple change alone, my sequential read benchmark goes from 23 seconds to .5
seconds.  There is a regression in backspace_6.f90 which implies we need to fix
back space and leave the above fix in place if possible.  The read test I am
using is reading a 36 megabyte unformatted file with ACCESS="stream".  This is
impressive!

My write test with same file goes from about 6 seconds to about .5 seconds as
well.


-- 


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


^ permalink raw reply	[flat|nested] 37+ messages in thread

* [Bug libfortran/33985] access="stream",form="unformatted" doesn't buffer
  2007-11-02 22:18 [Bug libfortran/33985] New: access="stream",form="unformatted" doesn't buffer tkoenig at gcc dot gnu dot org
                   ` (14 preceding siblings ...)
  2007-12-01  4:22 ` jvdelisle at gcc dot gnu dot org
@ 2007-12-01  4:28 ` howarth at nitro dot med dot uc dot edu
  2007-12-01  4:34 ` jvdelisle at gcc dot gnu dot org
                   ` (18 subsequent siblings)
  34 siblings, 0 replies; 37+ messages in thread
From: howarth at nitro dot med dot uc dot edu @ 2007-12-01  4:28 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #15 from howarth at nitro dot med dot uc dot edu  2007-12-01 04:28 -------
Hopefully this performance improvement can be backported for gcc 4.2.3 as well.


-- 


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


^ permalink raw reply	[flat|nested] 37+ messages in thread

* [Bug libfortran/33985] access="stream",form="unformatted" doesn't buffer
  2007-11-02 22:18 [Bug libfortran/33985] New: access="stream",form="unformatted" doesn't buffer tkoenig at gcc dot gnu dot org
                   ` (15 preceding siblings ...)
  2007-12-01  4:28 ` howarth at nitro dot med dot uc dot edu
@ 2007-12-01  4:34 ` jvdelisle at gcc dot gnu dot org
  2007-12-01  7:34 ` kargl at gcc dot gnu dot org
                   ` (17 subsequent siblings)
  34 siblings, 0 replies; 37+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2007-12-01  4:34 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #16 from jvdelisle at gcc dot gnu dot org  2007-12-01 04:34 -------
OK, found some other regressions as well.  I think we are still on the right
trail.  We can think about back porting after we get it really fixed. :)


-- 


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


^ permalink raw reply	[flat|nested] 37+ messages in thread

* [Bug libfortran/33985] access="stream",form="unformatted" doesn't buffer
  2007-11-02 22:18 [Bug libfortran/33985] New: access="stream",form="unformatted" doesn't buffer tkoenig at gcc dot gnu dot org
                   ` (16 preceding siblings ...)
  2007-12-01  4:34 ` jvdelisle at gcc dot gnu dot org
@ 2007-12-01  7:34 ` kargl at gcc dot gnu dot org
  2007-12-01 21:30 ` tkoenig at gcc dot gnu dot org
                   ` (16 subsequent siblings)
  34 siblings, 0 replies; 37+ messages in thread
From: kargl at gcc dot gnu dot org @ 2007-12-01  7:34 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #17 from kargl at gcc dot gnu dot org  2007-12-01 07:34 -------
(In reply to comment #15)
> Hopefully this performance improvement can be backported for gcc 4.2.3 as well.
> 

This is not a regression fix.  It therefore can't be backported.


-- 


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


^ permalink raw reply	[flat|nested] 37+ messages in thread

* [Bug libfortran/33985] access="stream",form="unformatted" doesn't buffer
  2007-11-02 22:18 [Bug libfortran/33985] New: access="stream",form="unformatted" doesn't buffer tkoenig at gcc dot gnu dot org
                   ` (17 preceding siblings ...)
  2007-12-01  7:34 ` kargl at gcc dot gnu dot org
@ 2007-12-01 21:30 ` tkoenig at gcc dot gnu dot org
  2007-12-01 21:50 ` howarth at nitro dot med dot uc dot edu
                   ` (15 subsequent siblings)
  34 siblings, 0 replies; 37+ messages in thread
From: tkoenig at gcc dot gnu dot org @ 2007-12-01 21:30 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #18 from tkoenig at gcc dot gnu dot org  2007-12-01 21:30 -------
(In reply to comment #13)
> Created an attachment (id=14676)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14676&action=view) [edit]

HI Jerry,

what is the reason why you still flush for formatted
stream i/o?


-- 


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


^ permalink raw reply	[flat|nested] 37+ messages in thread

* [Bug libfortran/33985] access="stream",form="unformatted" doesn't buffer
  2007-11-02 22:18 [Bug libfortran/33985] New: access="stream",form="unformatted" doesn't buffer tkoenig at gcc dot gnu dot org
                   ` (18 preceding siblings ...)
  2007-12-01 21:30 ` tkoenig at gcc dot gnu dot org
@ 2007-12-01 21:50 ` howarth at nitro dot med dot uc dot edu
  2007-12-01 21:53 ` tkoenig at gcc dot gnu dot org
                   ` (14 subsequent siblings)
  34 siblings, 0 replies; 37+ messages in thread
From: howarth at nitro dot med dot uc dot edu @ 2007-12-01 21:50 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #19 from howarth at nitro dot med dot uc dot edu  2007-12-01 21:50 -------
      I don't see the "Are we lucky and avoid syscall?" hack in the fd_seek
routine from unix.c of the gcc 4.0 branch. So one could argue that it was a
performance regression introduced in gcc 4.1.



-- 


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


^ permalink raw reply	[flat|nested] 37+ messages in thread

* [Bug libfortran/33985] access="stream",form="unformatted" doesn't buffer
  2007-11-02 22:18 [Bug libfortran/33985] New: access="stream",form="unformatted" doesn't buffer tkoenig at gcc dot gnu dot org
                   ` (19 preceding siblings ...)
  2007-12-01 21:50 ` howarth at nitro dot med dot uc dot edu
@ 2007-12-01 21:53 ` tkoenig at gcc dot gnu dot org
  2007-12-01 22:07 ` jvdelisle at gcc dot gnu dot org
                   ` (13 subsequent siblings)
  34 siblings, 0 replies; 37+ messages in thread
From: tkoenig at gcc dot gnu dot org @ 2007-12-01 21:53 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #20 from tkoenig at gcc dot gnu dot org  2007-12-01 21:53 -------
(In reply to comment #19)
>       I don't see the "Are we lucky and avoid syscall?" hack in the fd_seek
> routine from unix.c of the gcc 4.0 branch. So one could argue that it was a
> performance regression introduced in gcc 4.1.

Let's fix the problem first, without introducing any new regressions,
and then worry about backporting :-)


-- 


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


^ permalink raw reply	[flat|nested] 37+ messages in thread

* [Bug libfortran/33985] access="stream",form="unformatted" doesn't buffer
  2007-11-02 22:18 [Bug libfortran/33985] New: access="stream",form="unformatted" doesn't buffer tkoenig at gcc dot gnu dot org
                   ` (20 preceding siblings ...)
  2007-12-01 21:53 ` tkoenig at gcc dot gnu dot org
@ 2007-12-01 22:07 ` jvdelisle at gcc dot gnu dot org
  2007-12-01 22:08 ` kargl at gcc dot gnu dot org
                   ` (12 subsequent siblings)
  34 siblings, 0 replies; 37+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2007-12-01 22:07 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #21 from jvdelisle at gcc dot gnu dot org  2007-12-01 22:07 -------
Reply to comment #18, Thomas, A particular reason I do not recall.  Have you
tested without it?  It seems from the description of the alloc scheme in the
comments we should only have to free the stream (sfree).  Did you get my
off-list email.  This question ties into my general concern about understanding
the internals here and does it really do what we think it ought to.

Regarding comment #19, Jack, I would run my tests on the 4.0 branch and see
what we get, but we did not have "stream" access implemented then.  Maybe I
modify the tests and see what we get since fd_seek is used by all access
methods.


-- 


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


^ permalink raw reply	[flat|nested] 37+ messages in thread

* [Bug libfortran/33985] access="stream",form="unformatted" doesn't buffer
  2007-11-02 22:18 [Bug libfortran/33985] New: access="stream",form="unformatted" doesn't buffer tkoenig at gcc dot gnu dot org
                   ` (21 preceding siblings ...)
  2007-12-01 22:07 ` jvdelisle at gcc dot gnu dot org
@ 2007-12-01 22:08 ` kargl at gcc dot gnu dot org
  2007-12-01 22:19 ` tkoenig at gcc dot gnu dot org
                   ` (11 subsequent siblings)
  34 siblings, 0 replies; 37+ messages in thread
From: kargl at gcc dot gnu dot org @ 2007-12-01 22:08 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #22 from kargl at gcc dot gnu dot org  2007-12-01 22:08 -------
(In reply to comment #19)
>       I don't see the "Are we lucky and avoid syscall?" hack in the fd_seek
> routine from unix.c of the gcc 4.0 branch. So one could argue that it was a
> performance regression introduced in gcc 4.1.
> 

Stream IO first appeared in 4.2.  I'd find it highly unlikely that
you'ld find this in 4.1.  Now, as I said, this isn't a regression.
It is not a candidate for backporting!


-- 


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


^ permalink raw reply	[flat|nested] 37+ messages in thread

* [Bug libfortran/33985] access="stream",form="unformatted" doesn't buffer
  2007-11-02 22:18 [Bug libfortran/33985] New: access="stream",form="unformatted" doesn't buffer tkoenig at gcc dot gnu dot org
                   ` (22 preceding siblings ...)
  2007-12-01 22:08 ` kargl at gcc dot gnu dot org
@ 2007-12-01 22:19 ` tkoenig at gcc dot gnu dot org
  2007-12-02  2:05   ` Jerry DeLisle
  2007-12-02  2:05 ` jvdelisle at verizon dot net
                   ` (10 subsequent siblings)
  34 siblings, 1 reply; 37+ messages in thread
From: tkoenig at gcc dot gnu dot org @ 2007-12-01 22:19 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #23 from tkoenig at gcc dot gnu dot org  2007-12-01 22:19 -------
I'm studying why we get a regression in backspace_6.f, and
I'm confused by fd_alloc_r_at:



  gfc_offset m;

  if (where == -1)
    where = s->logical_offset;
...

What happens if where != -1 (if we use salloc_r_at)
and we hit the lines

  m = where + s->active;

  if (s->physical_offset != m && lseek (s->fd, m, SEEK_SET) < 0)
    return NULL;

I don't think this is correct.

We only use salloc_r_at form in backspace, so this
might be the reason for some mysterious bugs there.


-- 


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


^ permalink raw reply	[flat|nested] 37+ messages in thread

* [Bug libfortran/33985] access="stream",form="unformatted" doesn't buffer
  2007-11-02 22:18 [Bug libfortran/33985] New: access="stream",form="unformatted" doesn't buffer tkoenig at gcc dot gnu dot org
                   ` (23 preceding siblings ...)
  2007-12-01 22:19 ` tkoenig at gcc dot gnu dot org
@ 2007-12-02  2:05 ` jvdelisle at verizon dot net
  2007-12-02 18:45 ` jvdelisle at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  34 siblings, 0 replies; 37+ messages in thread
From: jvdelisle at verizon dot net @ 2007-12-02  2:05 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #24 from jvdelisle at verizon dot net  2007-12-02 02:05 -------
Subject: Re:  access="stream",form="unformatted" doesn't
 buffer

>   m = where + s->active;
> 
>   if (s->physical_offset != m && lseek (s->fd, m, SEEK_SET) < 0)
>     return NULL;
> 
> I don't think this is correct.

You are dead on, I have fixed this and have a patch regression testing now. The 
above did not break backspace_6.f90, but it broke some other things.  Stay
tuned.


-- 


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


^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [Bug libfortran/33985] access="stream",form="unformatted" doesn't  buffer
  2007-12-01 22:19 ` tkoenig at gcc dot gnu dot org
@ 2007-12-02  2:05   ` Jerry DeLisle
  0 siblings, 0 replies; 37+ messages in thread
From: Jerry DeLisle @ 2007-12-02  2:05 UTC (permalink / raw)
  To: gcc-bugzilla; +Cc: gcc-bugs

>   m = where + s->active;
> 
>   if (s->physical_offset != m && lseek (s->fd, m, SEEK_SET) < 0)
>     return NULL;
> 
> I don't think this is correct.

You are dead on, I have fixed this and have a patch regression testing now. The 
above did not break backspace_6.f90, but it broke some other things.  Stay tuned.


^ permalink raw reply	[flat|nested] 37+ messages in thread

* [Bug libfortran/33985] access="stream",form="unformatted" doesn't buffer
  2007-11-02 22:18 [Bug libfortran/33985] New: access="stream",form="unformatted" doesn't buffer tkoenig at gcc dot gnu dot org
                   ` (24 preceding siblings ...)
  2007-12-02  2:05 ` jvdelisle at verizon dot net
@ 2007-12-02 18:45 ` jvdelisle at gcc dot gnu dot org
  2007-12-02 18:55 ` jvdelisle at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  34 siblings, 0 replies; 37+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2007-12-02 18:45 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #25 from jvdelisle at gcc dot gnu dot org  2007-12-02 18:45 -------
Created an attachment (id=14682)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14682&action=view)
New patch, clean fix.

Answer to comment #18, Thomas, the flush is needed for streamio_12.f90 where we
use a write(10, pos=1) to reposition the file somewhere far from the current
buffer contents.

Status since comment#24.  Two regressions have led me to back away and take a
different approach.  I would still like to revisit the unix.c internals later.

For now, the attached patch gives the very substantial improvements in STREAM
i/o and regression tested OK on x86-64.  The patch is simple and well
contained.

I will post some benchmarks shortly and submit to list for approval.


-- 

jvdelisle at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #14676|0                           |1
        is obsolete|                            |


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


^ permalink raw reply	[flat|nested] 37+ messages in thread

* [Bug libfortran/33985] access="stream",form="unformatted" doesn't buffer
  2007-11-02 22:18 [Bug libfortran/33985] New: access="stream",form="unformatted" doesn't buffer tkoenig at gcc dot gnu dot org
                   ` (25 preceding siblings ...)
  2007-12-02 18:45 ` jvdelisle at gcc dot gnu dot org
@ 2007-12-02 18:55 ` jvdelisle at gcc dot gnu dot org
  2007-12-02 18:57 ` jvdelisle at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  34 siblings, 0 replies; 37+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2007-12-02 18:55 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #26 from jvdelisle at gcc dot gnu dot org  2007-12-02 18:55 -------
With this test case:

program main
  implicit none
  integer :: i, j
  open(95,form="unformatted",access="stream")
  do j=1, 125000
  do i=0,255
    write(95) int(i,kind=1)
  end do
  end do
end program main

gfortran 4.3 with patch

$ gfc pr33985.f90 
$ time ./a.out

real    0m5.823s
user    0m5.781s
sys     0m0.029s

gfortran 4.2 no patch

$ gfc42 -static pr33985.f90 
$ time ./a.out

real    1m8.781s
user    0m10.334s
sys     0m58.446s

Thats an 11.8 X improvement.


-- 


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


^ permalink raw reply	[flat|nested] 37+ messages in thread

* [Bug libfortran/33985] access="stream",form="unformatted" doesn't buffer
  2007-11-02 22:18 [Bug libfortran/33985] New: access="stream",form="unformatted" doesn't buffer tkoenig at gcc dot gnu dot org
                   ` (27 preceding siblings ...)
  2007-12-02 18:57 ` jvdelisle at gcc dot gnu dot org
@ 2007-12-02 18:57 ` jvdelisle at gcc dot gnu dot org
  2007-12-02 19:05 ` jvdelisle at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  34 siblings, 0 replies; 37+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2007-12-02 18:57 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #27 from jvdelisle at gcc dot gnu dot org  2007-12-02 18:57 -------
Created an attachment (id=14683)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14683&action=view)
A sequential read test


-- 


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


^ permalink raw reply	[flat|nested] 37+ messages in thread

* [Bug libfortran/33985] access="stream",form="unformatted" doesn't buffer
  2007-11-02 22:18 [Bug libfortran/33985] New: access="stream",form="unformatted" doesn't buffer tkoenig at gcc dot gnu dot org
                   ` (26 preceding siblings ...)
  2007-12-02 18:55 ` jvdelisle at gcc dot gnu dot org
@ 2007-12-02 18:57 ` jvdelisle at gcc dot gnu dot org
  2007-12-02 18:57 ` jvdelisle at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  34 siblings, 0 replies; 37+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2007-12-02 18:57 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #28 from jvdelisle at gcc dot gnu dot org  2007-12-02 18:57 -------
Created an attachment (id=14684)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14684&action=view)
A sequential write test


-- 


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


^ permalink raw reply	[flat|nested] 37+ messages in thread

* [Bug libfortran/33985] access="stream",form="unformatted" doesn't buffer
  2007-11-02 22:18 [Bug libfortran/33985] New: access="stream",form="unformatted" doesn't buffer tkoenig at gcc dot gnu dot org
                   ` (28 preceding siblings ...)
  2007-12-02 18:57 ` jvdelisle at gcc dot gnu dot org
@ 2007-12-02 19:05 ` jvdelisle at gcc dot gnu dot org
  2007-12-02 20:11 ` tkoenig at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  34 siblings, 0 replies; 37+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2007-12-02 19:05 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #29 from jvdelisle at gcc dot gnu dot org  2007-12-02 19:05 -------
gfortran 4.3 with patch:

$ gfc nwrite.f90 
$ time ./a.out

real    0m0.568s
user    0m0.533s
sys     0m0.035s
$ gfc nread.f90 
$ time ./a.out

real    0m0.527s
user    0m0.508s
sys     0m0.019s

gfortran 4.2, no patch:

$ gfc42 -static nwrite.f90 
$ time ./a.out

real    0m6.703s
user    0m1.423s
sys     0m5.280s
$ gfc42 -static nread.f90 
$ time ./a.out

real    0m16.721s
user    0m1.860s
sys     0m14.861s


-- 


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


^ permalink raw reply	[flat|nested] 37+ messages in thread

* [Bug libfortran/33985] access="stream",form="unformatted" doesn't buffer
  2007-11-02 22:18 [Bug libfortran/33985] New: access="stream",form="unformatted" doesn't buffer tkoenig at gcc dot gnu dot org
                   ` (29 preceding siblings ...)
  2007-12-02 19:05 ` jvdelisle at gcc dot gnu dot org
@ 2007-12-02 20:11 ` tkoenig at gcc dot gnu dot org
  2007-12-02 20:58 ` jvdelisle at verizon dot net
                   ` (3 subsequent siblings)
  34 siblings, 0 replies; 37+ messages in thread
From: tkoenig at gcc dot gnu dot org @ 2007-12-02 20:11 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #30 from tkoenig at gcc dot gnu dot org  2007-12-02 20:11 -------
(In reply to comment #25)
> Created an attachment (id=14682)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14682&action=view) [edit]
> New patch, clean fix.

Yes, this looks clean and self-contained (and something we can safely
incorporate into 4.3).

Although not strictly a regression-fix, I think this should also
be considered for 4.2.

This is now regtesting on my machine.

> Answer to comment #18, Thomas, the flush is needed for streamio_12.f90 where we
> use a write(10, pos=1) to reposition the file somewhere far from the current
> buffer contents.

I understand that.  What I meant to ask is: Why do we
still flush for formatted stream I/O?

> Status since comment#24.  Two regressions have led me to back away and take a
> different approach.  I would still like to revisit the unix.c internals later.

Probably not in time for 4.3, but this should be on the list for 4.4
(unless we stumble across a bug).  I'll try some stress-tests :-)

In general: Your patch does the right thing for both reading and
writing, as evidenced by the strace log:

$ cat readwrite.f90 
program main
  implicit none
  integer :: i
  integer(kind=1) r
  open(95,form="unformatted",access="stream")
  do i=0,10
    write(95) int(i,kind=1)
  end do
  close (95)
  open(95,form="unformatted",access="stream")
  do i=0,10
    read(95) r
  end do
end program main
$ gfortran readwrite.f90 
$ strace -e write,read,_llseek ./a.out
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0`\311\0"..., 512) = 512
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0`4\0\000"..., 512) =
512
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\360\30"..., 512) = 512
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\260a\1"..., 512) = 512
_llseek(0, 0, 0xbff954a0, SEEK_CUR)     = -1 ESPIPE (Illegal seek)
_llseek(1, 0, 0xbff95490, SEEK_CUR)     = -1 ESPIPE (Illegal seek)
_llseek(2, 0, 0xbff95490, SEEK_CUR)     = -1 ESPIPE (Illegal seek)
_llseek(3, 0, [0], SEEK_CUR)            = 0
write(3, "\0\1\2\3\4\5\6\7\10\t\n", 11) = 11
_llseek(3, 0, [0], SEEK_CUR)            = 0
read(3, "\0\1\2\3\4\5\6\7\10\t\n", 8192) = 11
read(3, "", 8181)                       = 0


-- 


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


^ permalink raw reply	[flat|nested] 37+ messages in thread

* [Bug libfortran/33985] access="stream",form="unformatted" doesn't buffer
  2007-11-02 22:18 [Bug libfortran/33985] New: access="stream",form="unformatted" doesn't buffer tkoenig at gcc dot gnu dot org
                   ` (30 preceding siblings ...)
  2007-12-02 20:11 ` tkoenig at gcc dot gnu dot org
@ 2007-12-02 20:58 ` jvdelisle at verizon dot net
  2007-12-02 21:20 ` tkoenig at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  34 siblings, 0 replies; 37+ messages in thread
From: jvdelisle at verizon dot net @ 2007-12-02 20:58 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #31 from jvdelisle at verizon dot net  2007-12-02 20:58 -------
Subject: Re:  access="stream",form="unformatted" doesn't
 buffer

tkoenig at gcc dot gnu dot org wrote:

>> Answer to comment #18, Thomas, the flush is needed for streamio_12.f90 where we
>> use a write(10, pos=1) to reposition the file somewhere far from the current
>> buffer contents.
> 
> I understand that.  What I meant to ask is: Why do we
> still flush for formatted stream I/O?
> 
:)  I misunderstood the question.  I am now regression testing without it.  We 
probably don't need it.


-- 


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


^ permalink raw reply	[flat|nested] 37+ messages in thread

* [Bug libfortran/33985] access="stream",form="unformatted" doesn't buffer
  2007-11-02 22:18 [Bug libfortran/33985] New: access="stream",form="unformatted" doesn't buffer tkoenig at gcc dot gnu dot org
                   ` (31 preceding siblings ...)
  2007-12-02 20:58 ` jvdelisle at verizon dot net
@ 2007-12-02 21:20 ` tkoenig at gcc dot gnu dot org
  2007-12-02 23:17 ` jvdelisle at gcc dot gnu dot org
  2007-12-02 23:32 ` jvdelisle at gcc dot gnu dot org
  34 siblings, 0 replies; 37+ messages in thread
From: tkoenig at gcc dot gnu dot org @ 2007-12-02 21:20 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #32 from tkoenig at gcc dot gnu dot org  2007-12-02 21:20 -------
Hi Jerry,

the regression-test went fine.

I'd say this is OK for commit.

Thomas


-- 


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


^ permalink raw reply	[flat|nested] 37+ messages in thread

* [Bug libfortran/33985] access="stream",form="unformatted" doesn't buffer
  2007-11-02 22:18 [Bug libfortran/33985] New: access="stream",form="unformatted" doesn't buffer tkoenig at gcc dot gnu dot org
                   ` (32 preceding siblings ...)
  2007-12-02 21:20 ` tkoenig at gcc dot gnu dot org
@ 2007-12-02 23:17 ` jvdelisle at gcc dot gnu dot org
  2007-12-02 23:32 ` jvdelisle at gcc dot gnu dot org
  34 siblings, 0 replies; 37+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2007-12-02 23:17 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #33 from jvdelisle at gcc dot gnu dot org  2007-12-02 23:17 -------
Subject: Bug 33985

Author: jvdelisle
Date: Sun Dec  2 23:17:16 2007
New Revision: 130574

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=130574
Log:
2007-12-02  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
            Thomas Koenig  <tkoenig@gcc.gnu.org>

        PR libfortran/33985
        * io/transfer.c (read_block, read_block_direct, write_block,
write_buf):
        Don't seek if file position is already there for STREAM I/O.
        (finalize_transfer): For STREAM I/O don't flush unless the file
position
        has moved past the start position before the transfer.

Modified:
    trunk/libgfortran/ChangeLog
    trunk/libgfortran/io/transfer.c


-- 


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


^ permalink raw reply	[flat|nested] 37+ messages in thread

* [Bug libfortran/33985] access="stream",form="unformatted" doesn't buffer
  2007-11-02 22:18 [Bug libfortran/33985] New: access="stream",form="unformatted" doesn't buffer tkoenig at gcc dot gnu dot org
                   ` (33 preceding siblings ...)
  2007-12-02 23:17 ` jvdelisle at gcc dot gnu dot org
@ 2007-12-02 23:32 ` jvdelisle at gcc dot gnu dot org
  34 siblings, 0 replies; 37+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2007-12-02 23:32 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #34 from jvdelisle at gcc dot gnu dot org  2007-12-02 23:32 -------
Lets close this and see what happens. (Jerry crosses his fingers) :)


-- 

jvdelisle at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|                            |FIXED


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


^ permalink raw reply	[flat|nested] 37+ messages in thread

end of thread, other threads:[~2007-12-02 23:32 UTC | newest]

Thread overview: 37+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-02 22:18 [Bug libfortran/33985] New: access="stream",form="unformatted" doesn't buffer tkoenig at gcc dot gnu dot org
2007-11-02 22:43 ` [Bug libfortran/33985] " fxcoudert at gcc dot gnu dot org
2007-11-03  0:42 ` jvdelisle at gcc dot gnu dot org
2007-11-03  1:18 ` jvdelisle at gcc dot gnu dot org
2007-11-03 14:57 ` jvdelisle at gcc dot gnu dot org
2007-11-03 15:06 ` jvdelisle at gcc dot gnu dot org
2007-11-06  2:41 ` jvdelisle at gcc dot gnu dot org
2007-11-06 16:17 ` dominiq at lps dot ens dot fr
2007-11-06 23:39 ` jvdelisle at gcc dot gnu dot org
2007-11-07  2:44 ` jvdelisle at gcc dot gnu dot org
2007-11-14  1:22 ` jvdelisle at gcc dot gnu dot org
2007-11-30 22:28 ` tkoenig at gcc dot gnu dot org
2007-11-30 22:45 ` jvdelisle at gcc dot gnu dot org
2007-11-30 22:57 ` tkoenig at gcc dot gnu dot org
2007-11-30 23:55 ` jvdelisle at gcc dot gnu dot org
2007-12-01  4:22 ` jvdelisle at gcc dot gnu dot org
2007-12-01  4:28 ` howarth at nitro dot med dot uc dot edu
2007-12-01  4:34 ` jvdelisle at gcc dot gnu dot org
2007-12-01  7:34 ` kargl at gcc dot gnu dot org
2007-12-01 21:30 ` tkoenig at gcc dot gnu dot org
2007-12-01 21:50 ` howarth at nitro dot med dot uc dot edu
2007-12-01 21:53 ` tkoenig at gcc dot gnu dot org
2007-12-01 22:07 ` jvdelisle at gcc dot gnu dot org
2007-12-01 22:08 ` kargl at gcc dot gnu dot org
2007-12-01 22:19 ` tkoenig at gcc dot gnu dot org
2007-12-02  2:05   ` Jerry DeLisle
2007-12-02  2:05 ` jvdelisle at verizon dot net
2007-12-02 18:45 ` jvdelisle at gcc dot gnu dot org
2007-12-02 18:55 ` jvdelisle at gcc dot gnu dot org
2007-12-02 18:57 ` jvdelisle at gcc dot gnu dot org
2007-12-02 18:57 ` jvdelisle at gcc dot gnu dot org
2007-12-02 19:05 ` jvdelisle at gcc dot gnu dot org
2007-12-02 20:11 ` tkoenig at gcc dot gnu dot org
2007-12-02 20:58 ` jvdelisle at verizon dot net
2007-12-02 21:20 ` tkoenig at gcc dot gnu dot org
2007-12-02 23:17 ` jvdelisle at gcc dot gnu dot org
2007-12-02 23:32 ` jvdelisle at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).