This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libfortran/38668] New: advance="no": no buffering, truncate and seek
- From: "tkoenig at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 30 Dec 2008 09:28:16 -0000
- Subject: [Bug libfortran/38668] New: advance="no": no buffering, truncate and seek
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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