https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63352
--- Comment #4 from Richard PALO <richard at netbsd dot org> --- Just checked with the native omnios gcc 4.8.1 and the problem already exists there. I commented as indicated to be able to get debugger output for 2nd part: diff --git a/gcc/testsuite/gfortran.dg/fmt_g0_1.f08 b/gcc/testsuite/gfortran.dg/fmt_g0_1.f08 index ead6f81..3cceae6 100644 --- a/gcc/testsuite/gfortran.dg/fmt_g0_1.f08 +++ b/gcc/testsuite/gfortran.dg/fmt_g0_1.f08 @@ -8,7 +8,7 @@ write(buffer, string) ':',0,':' if (buffer.ne.":0:") call abort write(buffer, string) ':',1.0_8/3.0_8,':' - if (buffer.ne.":.33333333333333331:") call abort +! if (buffer.ne.":.33333333333333331:") call abort write(buffer, '(1x,a,g0,a)') ':',1.0_8/3.0_8,':' if (buffer.ne." :.33333333333333331:") call abort write(buffer, string) ':',"hello",':' with 4.9.1 buffer is as follows for the two writes with 1/3: (gdb) p buffer $1 = ':.', '3' <repeats 16 times>, '2:', ' ' <repeats 30 times> (gdb) n (gdb) p buffer $2 = ' :.', '3' <repeats 16 times>, '2:', ' ' <repeats 29 times> under 4.7.3: (gdb) p buffer $1 = ':.', '3' <repeats 16 times>, '1:', ' ' <repeats 30 times> (gdb) n (gdb) p buffer $2 = ' :.', '3' <repeats 16 times>, '1:', ' ' <repeats 29 times>