Bug 25631 - tl format specifier not working correctly
Summary: tl format specifier not working correctly
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: libfortran (show other bugs)
Version: 4.2.0
: P3 normal
Target Milestone: 4.1.0
Assignee: Jerry DeLisle
URL:
Keywords:
Depends on:
Blocks: 19282
  Show dependency treegraph
 
Reported: 2006-01-02 06:52 UTC by Jerry DeLisle
Modified: 2006-02-13 03:33 UTC (History)
1 user (show)

See Also:
Host: i696-pc-linux-gnu
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2006-01-03 07:16:32


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jerry DeLisle 2006-01-02 06:52:42 UTC
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    <
Comment 1 Andrew Pinski 2006-01-02 06:57:26 UTC
Confirmed.
Comment 2 Jerry DeLisle 2006-01-03 07:16:32 UTC
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.
Comment 3 Jerry DeLisle 2006-01-08 09:39:18 UTC
Patch submitted for review.
Comment 4 Jerry DeLisle 2006-01-18 00:52:25 UTC
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

Comment 5 Jerry DeLisle 2006-01-18 01:06:12 UTC
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

Comment 6 Jerry DeLisle 2006-01-18 04:27:36 UTC
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

Comment 7 Jerry DeLisle 2006-01-18 04:32:19 UTC
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

Comment 8 Jerry DeLisle 2006-01-18 06:48:59 UTC
Fixed on 4.1 and 4.2
Comment 9 patchapp@dberlin.org 2006-02-13 03:30:41 UTC
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
Comment 10 Daniel Berlin 2006-02-13 03:33:49 UTC
(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 :)