https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111022
--- Comment #18 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> --- 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. 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?