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: [email protected]
ReportedBy: [email protected]
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.