[Bug fortran/19302] New: nearest test case fails

coudert at clipper dot ens dot fr gcc-bugzilla@gcc.gnu.org
Thu Jan 6 23:24:00 GMT 2005


The test intrinsic_nearest.f90 from the fortran testsuite included with gcc
fails on sparc-sun-solaris2.9 will all optimization levels. I can reduce it to
the following code:

-------------------------------------------
program test_nearest
  real inf, max, x
  integer infi, maxi
  equivalence (inf,infi)
  equivalence (max,maxi)

! ??? This is pretty sketchy, but passes on most targets.
  infi = z'7f800000'
  maxi = z'7f7fffff'

  x = nearest (-inf, 1.0)
  print *, x, -max
  if (x .ne. -max) call abort()
end
-------------------------------------------

The comment (from the original test file) makes me feel that perhaps the nearest
intrinsic is fine but only the values for infi and maxi are proven wrong, but
I'm not really sure. And, if it's the case, some "more universal" values should
be fed in.

-- 
           Summary: nearest test case fails
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: coudert at clipper dot ens dot fr
                CC: gcc-bugs at gcc dot gnu dot org
GCC target triplet: sparc-sun-solaris2.9


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



More information about the Gcc-bugs mailing list