https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111022

anlauf at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |anlauf at gcc dot gnu.org

--- Comment #19 from anlauf at gcc dot gnu.org ---
(In reply to Jerry DeLisle from comment #18)
> With Johns test case from Comment #15 and the patch in Comment #17 I get the
> following:
> 
> $ ./a.out 
> real kinds 4 8 10 16
> With (A,1X,EN0.0  ) 666.
> With (A,1X,EN0.0  ) 666.
> With (A,1X,EN0.0  ) 666.
> With (A,1X,EN0.0  ) 666.
> With (A,1X,EN0.0E0) 666.
> With (A,1X,EN0.0E0) 666.
> With (A,1X,EN0.0E0) 666.
> With (A,1X,EN0.0E0) 666.

Intel prints

With (A,1X,EN0.0E0) 666.+0

which I think is slightly more in accordance with F2018 Table 13.2,
which requires printing the exponent for the ...E0 version with the
minimum number of digits, which is 1 for a zero exponent.
See the "footnote (1)" there.

Can you please check?  Or am I missing something?

> With (A,1X,ES0.0  ) 7.E+2
> With (A,1X,ES0.0  ) 7.E+2
> With (A,1X,ES0.0  ) 7.E+2
> With (A,1X,ES0.0  ) 7.E+2
> With (A,1X,ES0.0E0) 7.E+2
> With (A,1X,ES0.0E0) 7.E+2
> With (A,1X,ES0.0E0) 7.E+2
> With (A,1X,ES0.0E0) 7.E+2
> ERROR STOP Scale factor out of range in format specifier 'E' or 'D'
> 
> Notice that the width of exponents is also minimized and where the exponent
> is zero it is not shown at all.  If I do specify an exponent width it shown.
> For example with exponent width of 4 and changing the value to 66600 I get:
> 
> $ ./a.out 
> real kinds 4 8 10 16
> With (A,1X,EN0.0  ) 67.E+3
> With (A,1X,EN0.0  ) 67.E+3
> With (A,1X,EN0.0  ) 67.E+3
> With (A,1X,EN0.0  ) 67.E+3
> With (A,1X,EN0.0E4) 67.E+0003
> With (A,1X,EN0.0E4) 67.E+0003
> With (A,1X,EN0.0E4) 67.E+0003
> With (A,1X,EN0.0E4) 67.E+0003
> With (A,1X,ES0.0  ) 7.E+4
> With (A,1X,ES0.0  ) 7.E+4
> With (A,1X,ES0.0  ) 7.E+4
> With (A,1X,ES0.0  ) 7.E+4
> With (A,1X,ES0.0E4) 7.E+0004
> With (A,1X,ES0.0E4) 7.E+0004
> With (A,1X,ES0.0E4) 7.E+0004
> With (A,1X,ES0.0E4) 7.E+0004
> ERROR STOP Scale factor out of range in format specifier 'E' or 'D'
> 
> This seems reasonable to me. Other opinions?

Reply via email to