------- Additional Comments From fxcoudert at gcc dot gnu dot org  2005-05-31 
07:38 -------
First thing: I can reproduce the timings differences on my i386-linux, with ext3
filesystem.

Second thing: Steve, your patch truncates files, which is not correct! Given the
following modified testcase:

$ cat pr21820.f90
   program kl
   integer i,j,k
   integer, parameter :: m = 1000, n = 300, n2 = 20
   real x(m,n)
   x = 1.e0
   inquire(iolength=k) (x(i,1), i=1, m)
   open(unit=1, file='foo.dat', access='direct', recl=k)
   do j = 1, n
      write(1,rec=j) (x(i,j), i=1, n)
   end do
   close(1)
   open(unit=1, file='foo.dat', access='direct', recl=k)
   do j = 1, n2
      write(1,rec=j) (x(i,j), i=1, n)
   end do
   close(1)
   end program kl

With an unpatched gfortran, I get:
$ ./a.out && ll foo.dat                  
-rw-r--r--  1 fx fx 1.2M May 31 09:38 foo.dat

while your patch yields to:

$ ./a.out && ll foo.dat
-rw-r--r--  1 fx fx 76K May 31 09:35 foo.dat

See the difference in sizes!

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2005-05-31 07:38:40
               date|                            |


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

Reply via email to