------- Comment #5 from fxcoudert at gcc dot gnu dot org 2009-09-05 10:10 ------- I can confirm the issue with Steve's testcase on a (i686-darwin) to (i586-pc-mingw32) cross-compiler, at trunk revision 151373. The issue can even be seen while running the compiled program under wine, which should make it rather easy to reproduce without having to deal with Windows :)
I even have a simplified testcase, with one big write (and no CPU consumption dealing with integer formating): implicit none character(len=1024*1024), parameter :: mb = "" integer :: i open(1, file = 't2.dat') write (1,"(A)") (mb, i = 1, 2*1024 + 100) close(1) end $ ls -l t2* -rw-r--r-- 1 fx staff 2252343396 Sep 5 12:05 t2-darwin.dat -rw-r--r-- 1 fx staff 2251296966 Sep 5 12:06 t2-mingw.dat where t2-darwin.dat is produced by the darwin executable, and t2.dat is produced by the mingw executable. Please note: the sizes should actually not be equal, but t2-mingw.dat should have exactly 2148 more bytes (= 2*1024 + 100) because mingw has CR+LF line endings. -- fxcoudert at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fxcoudert at gcc dot gnu dot | |org Status|UNCONFIRMED |NEW Ever Confirmed|0 |1 GCC build triplet|Same | GCC host triplet|Windows XP Pro, Core2Quad | |Q6600, 2Gb RAM | GCC target triplet|Same |i586-pc-mingw32 Keywords| |wrong-code Known to fail| |4.5.0 Last reconfirmed|0000-00-00 00:00:00 |2009-09-05 10:10:54 date| | Summary|Incorrectly writes/reads |Files > 2GB are incorrectly |formatted ASCII files |handled on mingw |greater than 2Gb | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40812