[Bug fortran/31202] New: wrong code generated with gfortran
jv244 at cam dot ac dot uk
gcc-bugzilla@gcc.gnu.org
Fri Mar 16 11:27:00 GMT 2007
With a recent gfortran, the following compiles, but generates the wrong
results:
! http://gcc.gnu.org/ml/fortran/2005-04/msg00139.html
real*8 :: a
integer*8 :: i1,i2
a=.4999999999999999444888487687421729788184165954589843750_8
i2=NINT(.4999999999999999444888487687421729788184165954589843750_8)
i1=NINT(a)
! 0.499999999999999944488848768742 0 0
write(6,'(F40.30,2I2)') a,i1,i2
IF (i1.NE.i2) CALL ABORT()
a=4503599627370497.0_8
i1=NINT(a,KIND=8)
i2=NINT(4503599627370497.0_8,KIND=8)
! 4503599627370497 4503599627370497 4503599627370497
write(6,*) 4503599627370497_8,i1,i2
IF (i1.NE.i2) CALL ABORT()
END
--
Summary: wrong code generated with gfortran
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: jv244 at cam dot ac dot uk
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31202
More information about the Gcc-bugs
mailing list