gfortran [trunk revision 134945] generates wrong output for the following testcase (derived from CP2K) : write(6,FMT='(T2,A,T10,A)') "23456789012345","ABC" END yields: 23456789012345ABC instead of: 23456789ABC345
I will have a look. Odd, I don't recall anything going near this recently.
*** Bug 36142 has been marked as a duplicate of this bug. ***
The regression occurs from r132512, the change to transfer.c The test case from pr36142 is: ! { dg-do run } ! Adapted from fmt_t_6.f testcase for PR 34782 character a(6) data a / 'a', 'b', 'c', 'd', 'e', 'f' / write(*,'(T20,A3, T1,A4, T5,A2, T7,A2, T9,A4, T17,A2)') 1 'a', 'b', 'c', 'd', 'e', 'f' print *, 'should be' write (*, '(A)') " b c d e f a" end By reverting the relevant portion of the patch, these two test cases pass which leaves fmt_t_7.f failing which the original patch was intended for. fmt_t_7.f is an extreme case which is not time critical to fix. I plan to revert the patch and xfail fmt_t_7.f90 until we sort this out further. See my comment to pr36142 on the alloc facility.
Subject: Bug 36131 Author: jvdelisle Date: Tue May 6 04:00:38 2008 New Revision: 134973 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=134973 Log: 2008-05-05 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR libfortran/36131 * io/transfer.c (formatted_transfer_scalar): Revert patch for PR34974. (next_record_w): Likewise. Modified: trunk/libgfortran/ChangeLog trunk/libgfortran/io/transfer.c
Fixed on trunk, reopened PR34974
Hi Jerry, did you commit the test case to make sure we don't regress again? Thomas
One of the problems here is how to do a test case for writing to stdout. We would have to create a pipe and write to it and read back from the other side. I don't know how to do that in the testsuite.