[Bug libfortran/83811] New: fortran 'e' format broken for single digit exponents

alexander.heger at monash dot edu gcc-bugzilla@gcc.gnu.org
Fri Jan 12 07:29:00 GMT 2018


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

            Bug ID: 83811
           Summary: fortran 'e' format broken for single digit exponents
           Product: gcc
           Version: 7.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libfortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: alexander.heger at monash dot edu
  Target Milestone: ---

~/test>gfortran --version
GNU Fortran (GCC) 7.2.1 20170915 (Red Hat 7.2.1-2)
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

~/test>cat test.f
      program test
      character*10 :: s
      write(s, '(1pe5.0e1)') 1.e-4
      print*,s
      write(s, '(e5.1e1)') 1.e12
      print*,s
      end
~/test>gfortran test.f
~/test>./a.out
 1.E+0
 .1E+2 

This does not look right to me.  It broke some time with version 7.1.x (Fedora
26 default) but remains broken in 7.2.1 (Fedora 27).  Was still OK in Fedora
25.

As a side note, if I replace the first 'e' by 'g' in each format string, the
formatting works as expected 

 1.E-4     
 *****     

-Alexander


More information about the Gcc-bugs mailing list