This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/33595] FAIL: gfortran.dg/nint_2.f90 -O0 execution test
- From: "billingd at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 4 Dec 2008 03:04:09 -0000
- Subject: [Bug fortran/33595] FAIL: gfortran.dg/nint_2.f90 -O0 execution test
- References: <bug-33595-276@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #6 from billingd at gcc dot gnu dot org 2008-12-04 03:04 -------
Just had a look at this with cvs gfortran under cygwin.
A slightly modified test
program intrinsic_integer
implicit none
call test (0.0, (/0, 0, 0, 0/))
call test (0.3, (/0, 1, 0, 0/))
call test (0.7, (/0, 1, 0, 1/))
call test (-0.3, (/-1, 0, 0, 0/))
call test (-0.7, (/-1, 0, 0, -1/))
contains
subroutine test(val, res)
real :: val
integer, dimension(4) :: res
if ((floor(val) .ne. res(1)) .or. (ceiling(val) .ne. res(2)) &
.or. (int(val) .ne. res(3)) .or. (nint(val) .ne. res(4))) then
write(6,'(a,f4.1,a,i2,a,i2)') 'nint(', val, ')=', nint(val), &
' require ', res(4)
end if
end subroutine
end program
at -O0, -O1, -O2 and -O3 gives
nint( 0.7)= 0 require 1
nint(-0.7)= 0 require -1
The C test program at #1, compiled with gcc-3.4.4 or CVS gcc 4.4.0 20081128
(experimental) [trunk revision 142255] gives "0 1 1" as expected.
--
billingd at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |billingd at gcc dot gnu dot
| |org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33595