While studying some test cases for pr24268 I discovered this: program tl real x character*13 line x = 12.34 write(line,20) x 20 format(tr2,tl2,g11.4) print *, "123456789012345" print *, ">",line,"<" end The tl2 is not getting processed so the numbers printed within the field are shifted to the right by two spaces. $ g77 fmt_tl.f $ ./a.out 123456789012345 > 12.34 < $ gfc fmt_tl.f $ ./a.out 123456789012345 > 12.34 <
Confirmed.
TL does not take into account pending spaces and skips when no bytes have been used yet so it 'thinks' that it is at the beginning of the record and can not go left.
Patch submitted for review.
Subject: Bug 25631 Author: jvdelisle Date: Wed Jan 18 00:52:21 2006 New Revision: 109858 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=109858 Log: 2006-01-17 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR libgfortran/25631 * io/transfer.c (formatted_transfer_scalar): Adjust pending_spaces and skips so that TL works correctly when no bytes_used yet. Modified: trunk/libgfortran/ChangeLog trunk/libgfortran/io/transfer.c
Subject: Bug 25631 Author: jvdelisle Date: Wed Jan 18 01:06:08 2006 New Revision: 109860 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=109860 Log: 2006-01-17 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/25631 * gfortran.dg/fmt_tl.f: New test. Added: trunk/gcc/testsuite/gfortran.dg/fmt_tl.f Modified: trunk/gcc/testsuite/ChangeLog
Subject: Bug 25631 Author: jvdelisle Date: Wed Jan 18 04:27:31 2006 New Revision: 109868 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=109868 Log: 2006-01-17 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR libgfortran/25631 * io/transfer.c (formatted_transfer_scalar): Adjust pending_spaces and skips so that TL works correctly when no bytes_used yet. Modified: branches/gcc-4_1-branch/libgfortran/ChangeLog branches/gcc-4_1-branch/libgfortran/io/transfer.c
Subject: Bug 25631 Author: jvdelisle Date: Wed Jan 18 04:32:16 2006 New Revision: 109869 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=109869 Log: 2006-01-17 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/25631 * gfortran.dg/fmt_tl.f: New test. Added: branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/fmt_tl.f Modified: branches/gcc-4_1-branch/gcc/testsuite/ChangeLog
Fixed on 4.1 and 4.2
Subject: Bug number PR25631 A patch for this bug has been added to the patch tracker. The mailing list url for the patch is http://gcc.gnu.org/ml/gcc-patches/2006-01/msg00439.html
(In reply to comment #9) > Subject: Bug number PR25631 > > A patch for this bug has been added to the patch tracker. > The mailing list url for the patch is > http://gcc.gnu.org/ml/gcc-patches/2006-01/msg00439.html > Sorry, this was a test, i didn't mean for it to actually send mail :)