This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/55539] New: [4.8 Regression] -fno-sign-zero may generate wrong formatted output


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55539

             Bug #: 55539
           Summary: [4.8 Regression] -fno-sign-zero may generate wrong
                    formatted output
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: anlauf@gmx.de


The code

program gfcbug120
  implicit none
  real(4) :: x = -1.2e-3
  real(8) :: y = -1.2e-3
  print *, x, y
  print '(7f10.3)', x, y
end program gfcbug120

incorrectly prints

  -1.20000006E-03  -1.2000000569969416E-003
     0.001     0.001

with -fno-sign-zero; the correct result would be

  -1.20000006E-03  -1.2000000569969416E-003
    -0.001    -0.001

This works with 4.7.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]