public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/19302] New: nearest test case fails
@ 2005-01-06 23:24 coudert at clipper dot ens dot fr
  2005-01-06 23:28 ` [Bug fortran/19302] " pinskia at gcc dot gnu dot org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: coudert at clipper dot ens dot fr @ 2005-01-06 23:24 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug fortran/19302] nearest test case fails
  2005-01-06 23:24 [Bug fortran/19302] New: nearest test case fails coudert at clipper dot ens dot fr
@ 2005-01-06 23:28 ` pinskia at gcc dot gnu dot org
  2005-01-07  0:32 ` [Bug fortran/19302] intrinsic_nearest.f90 fails ebotcazou at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-01-06 23:28 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-01-06 23:28 -------
I think this is a dup of bug 17675.

-- 


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


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug fortran/19302] intrinsic_nearest.f90 fails
  2005-01-06 23:24 [Bug fortran/19302] New: nearest test case fails coudert at clipper dot ens dot fr
  2005-01-06 23:28 ` [Bug fortran/19302] " pinskia at gcc dot gnu dot org
@ 2005-01-07  0:32 ` ebotcazou at gcc dot gnu dot org
  2005-01-07  0:33 ` ebotcazou at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2005-01-07  0:32 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From ebotcazou at gcc dot gnu dot org  2005-01-07 00:32 -------
Confirmed on all SPARC/Solaris platforms (32-bit or 64-bit).


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ebotcazou at gcc dot gnu dot
                   |                            |org
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
  GCC build triplet|                            |sparc-sun-solaris2.*
   GCC host triplet|                            |sparc-sun-solaris2.*
 GCC target triplet|sparc-sun-solaris2.9        |sparc-sun-solaris2.*
   Last reconfirmed|0000-00-00 00:00:00         |2005-01-07 00:32:29
               date|                            |
            Summary|nearest test case fails     |intrinsic_nearest.f90 fails
            Version|unknown                     |4.0.0


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


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug fortran/19302] intrinsic_nearest.f90 fails
  2005-01-06 23:24 [Bug fortran/19302] New: nearest test case fails coudert at clipper dot ens dot fr
  2005-01-06 23:28 ` [Bug fortran/19302] " pinskia at gcc dot gnu dot org
  2005-01-07  0:32 ` [Bug fortran/19302] intrinsic_nearest.f90 fails ebotcazou at gcc dot gnu dot org
@ 2005-01-07  0:33 ` ebotcazou at gcc dot gnu dot org
  2005-01-07 10:57 ` Thomas dot Koenig at online dot de
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2005-01-07  0:33 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From ebotcazou at gcc dot gnu dot org  2005-01-07 00:33 -------
> I think this is a dup of bug 17675.

I'm not sure: I've Steve's patch for PR 17675 in my tree and I still see the
failures everywhere.


-- 


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


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug fortran/19302] intrinsic_nearest.f90 fails
  2005-01-06 23:24 [Bug fortran/19302] New: nearest test case fails coudert at clipper dot ens dot fr
                   ` (2 preceding siblings ...)
  2005-01-07  0:33 ` ebotcazou at gcc dot gnu dot org
@ 2005-01-07 10:57 ` Thomas dot Koenig at online dot de
  2005-01-07 12:30 ` coudert at clipper dot ens dot fr
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Thomas dot Koenig at online dot de @ 2005-01-07 10:57 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From Thomas dot Koenig at online dot de  2005-01-07 10:56 -------
I am not sure that this is indeed a bug.

Is the result of nearest for +/- infinity defined to
be +/huge ?

Look at what ifort does:

$ cat near-inf.f90
program test_nearest
  real inf
  inf = exp(1000.)
  print *,inf
  print *,nearest(inf,-1.0)
  print *,nearest(-inf,1.0)
end
$ ifort near-inf.f90
$ ./a.out
 Infinity
 Infinity
 -Infinity


-- 


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


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug fortran/19302] intrinsic_nearest.f90 fails
  2005-01-06 23:24 [Bug fortran/19302] New: nearest test case fails coudert at clipper dot ens dot fr
                   ` (3 preceding siblings ...)
  2005-01-07 10:57 ` Thomas dot Koenig at online dot de
@ 2005-01-07 12:30 ` coudert at clipper dot ens dot fr
  2005-01-24  7:30 ` coudert at clipper dot ens dot fr
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: coudert at clipper dot ens dot fr @ 2005-01-07 12:30 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From coudert at clipper dot ens dot fr  2005-01-07 12:30 -------
(reply to comment #4)

After your comment, not sure either if it's a bug. The original testcase
(intrinsic_nearest.f90) fails with Intel (7 and 8) and Portland Group compilers
on i686, but works with g95 and gfortran on i686. On sparc-sun-solaris, it works
with Sun's f90 compiler but (as we know!) fails with gfortran.

-- 


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


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug fortran/19302] intrinsic_nearest.f90 fails
  2005-01-06 23:24 [Bug fortran/19302] New: nearest test case fails coudert at clipper dot ens dot fr
                   ` (4 preceding siblings ...)
  2005-01-07 12:30 ` coudert at clipper dot ens dot fr
@ 2005-01-24  7:30 ` coudert at clipper dot ens dot fr
  2005-02-12 22:25 ` ebotcazou at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: coudert at clipper dot ens dot fr @ 2005-01-24  7:30 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From coudert at clipper dot ens dot fr  2005-01-24 07:30 -------
I confirm comment #3: PR 17675 is fixed, but this bug still appears on the
nightly test logs I do on sparc-sun-solaris2.9. Bug or not, this should be fixed
(either the compiler or the testcase).

I incline to think that the result for the code should be the same for gfortran
on i686 and sparc 32-bit.

-- 


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


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug fortran/19302] intrinsic_nearest.f90 fails
  2005-01-06 23:24 [Bug fortran/19302] New: nearest test case fails coudert at clipper dot ens dot fr
                   ` (5 preceding siblings ...)
  2005-01-24  7:30 ` coudert at clipper dot ens dot fr
@ 2005-02-12 22:25 ` ebotcazou at gcc dot gnu dot org
  2005-02-20 15:52 ` [Bug libfortran/19302] " ebotcazou at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2005-02-12 22:25 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From ebotcazou at gcc dot gnu dot org  2005-02-12 19:20 -------
It's a bug in intrinsics/c99_functions.c:nextafterf.  Fixing.


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|ebotcazou at gcc dot gnu dot|
                   |org                         |
         AssignedTo|unassigned at gcc dot gnu   |ebotcazou at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED


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


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug libfortran/19302] intrinsic_nearest.f90 fails
  2005-01-06 23:24 [Bug fortran/19302] New: nearest test case fails coudert at clipper dot ens dot fr
                   ` (6 preceding siblings ...)
  2005-02-12 22:25 ` ebotcazou at gcc dot gnu dot org
@ 2005-02-20 15:52 ` ebotcazou at gcc dot gnu dot org
  2005-02-22  0:54 ` cvs-commit at gcc dot gnu dot org
  2005-02-22  1:15 ` ebotcazou at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2005-02-20 15:52 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From ebotcazou at gcc dot gnu dot org  2005-02-20 07:42 -------
Proposed fix: http://gcc.gnu.org/ml/fortran/2005-02/msg00098.html


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch


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


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug libfortran/19302] intrinsic_nearest.f90 fails
  2005-01-06 23:24 [Bug fortran/19302] New: nearest test case fails coudert at clipper dot ens dot fr
                   ` (7 preceding siblings ...)
  2005-02-20 15:52 ` [Bug libfortran/19302] " ebotcazou at gcc dot gnu dot org
@ 2005-02-22  0:54 ` cvs-commit at gcc dot gnu dot org
  2005-02-22  1:15 ` ebotcazou at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-02-22  0:54 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2005-02-21 21:39 -------
Subject: Bug 19302

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	ebotcazou@gcc.gnu.org	2005-02-21 21:39:33

Modified files:
	libgfortran    : ChangeLog 
	libgfortran/intrinsics: c99_functions.c 

Log message:
	PR libfortran/19302
	* intrinsics/c99_functions.c (nextafterf): Special-case infinite
	numbers.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libgfortran/ChangeLog.diff?cvsroot=gcc&r1=1.160&r2=1.161
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libgfortran/intrinsics/c99_functions.c.diff?cvsroot=gcc&r1=1.9&r2=1.10



-- 


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


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug libfortran/19302] intrinsic_nearest.f90 fails
  2005-01-06 23:24 [Bug fortran/19302] New: nearest test case fails coudert at clipper dot ens dot fr
                   ` (8 preceding siblings ...)
  2005-02-22  0:54 ` cvs-commit at gcc dot gnu dot org
@ 2005-02-22  1:15 ` ebotcazou at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2005-02-22  1:15 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From ebotcazou at gcc dot gnu dot org  2005-02-21 21:42 -------
Patch installed.


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |4.0.0


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


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2005-02-21 21:43 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-01-06 23:24 [Bug fortran/19302] New: nearest test case fails coudert at clipper dot ens dot fr
2005-01-06 23:28 ` [Bug fortran/19302] " pinskia at gcc dot gnu dot org
2005-01-07  0:32 ` [Bug fortran/19302] intrinsic_nearest.f90 fails ebotcazou at gcc dot gnu dot org
2005-01-07  0:33 ` ebotcazou at gcc dot gnu dot org
2005-01-07 10:57 ` Thomas dot Koenig at online dot de
2005-01-07 12:30 ` coudert at clipper dot ens dot fr
2005-01-24  7:30 ` coudert at clipper dot ens dot fr
2005-02-12 22:25 ` ebotcazou at gcc dot gnu dot org
2005-02-20 15:52 ` [Bug libfortran/19302] " ebotcazou at gcc dot gnu dot org
2005-02-22  0:54 ` cvs-commit at gcc dot gnu dot org
2005-02-22  1:15 ` ebotcazou at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).