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 libfortran/38668] New: advance="no": no buffering, truncate and seek


We currently have a terribly inefficient implementation of
advance="no":

$ cat write-advance.f
      program main
      do i=1,10**6
        write (10,fmt='(A)',advance='no') 'a'
      end do
      end
$ gfortran -O write-advance.f

stracing this leads to

_llseek(3, 0, [0], SEEK_SET)            = 0
ftruncate64(3, 0)                       = 0
write(3, "a"..., 1)                     = 1
_llseek(3, 1, [1], SEEK_SET)            = 0
ftruncate64(3, 1)                       = 0
_llseek(3, 1, [1], SEEK_SET)            = 0
ftruncate64(3, 1)                       = 0
write(3, "a"..., 1)                     = 1
_llseek(3, 2, [2], SEEK_SET)            = 0
ftruncate64(3, 2)                       = 0
write(3, "a"..., 1)                     = 1
_llseek(3, 3, [3], SEEK_SET)            = 0
ftruncate64(3, 3)                       = 0
write(3, "a"..., 1)                     = 1


-- 
           Summary: advance="no": no buffering, truncate and seek
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P3
         Component: libfortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: tkoenig at gcc dot gnu dot org
OtherBugsDependingO 38654
             nThis:


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


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