Bug 15115 - scaling factor on F format not applied
Summary: scaling factor on F format not applied
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: libfortran (show other bugs)
Version: tree-ssa
: P2 normal
Target Milestone: 4.0.0
Assignee: Bud Davis
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-04-24 12:45 UTC by bdavis9659
Modified: 2004-09-07 19:29 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2004-05-17 20:05:22


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description bdavis9659 2004-04-24 12:45:03 UTC
from NIST test FM405.FOR

$ cat e.f
        CHARACTER B381K(4)*38
        B381K(1) = '   23   23.345     T ENDS             '
        B381K(2) = ' 23.456     F    98 YOURS PROGRAMS    '
        B381K(3) = ' 13.1234  13.1234E0 1312.34           '
        B381K(4) = '   5.2345   56    5.2345 T TRUE 5.2345'
        READ(B381K(3),39036) AVS, BVS, CVS
        PRINT*,'AVS = ',AVS
        PRINT*,'BVS = ',BVS
        PRINT*,'CVS = ',CVS
39036   FORMAT(F9.5, 1X, E9.3, 1X, 2PF7.4)
        END
 
$ gfortran e.f
$ ./a.out
AVS =     13.12340
BVS =     13.12340
CVS =     1312.340
           ^^^
           wrong, should be 13.12340

$ g77 e.f
$ ./a.out
 AVS =   13.1233997
 BVS =   13.1233997
 CVS =   13.1233997
Comment 1 Andrew Pinski 2004-04-24 13:55:09 UTC
Confirmed.
Comment 2 Paul Brook 2004-09-07 10:48:07 UTC
Fixed, most likely by this: 
2004-09-02  Paul Brook  <paul@codesourcery.com> 
 
        * io/format.c (parse_format_list): Set repeat count for P descriptors. 
        * write.c (output_float): Fix condition.  Correctly handle nonzero 
        scale factor.