Executing on host: /xxx/gnu/gcc/objdir/gcc/testsuite/gfortran/../../gfortran -B/xxx/gnu/gcc/objdir/gcc/testsuite/gfortran/../../ /xxx/gnu/gcc/gcc/gcc/testsuite/gfortran.dg/nan_3.f90 -O0 -fno-range-check -L/xxx/gnu/gcc/objdir/hppa1.1-hp-hpux10.20/./libgfortran/.libs -L/xxx/gnu/gcc/objdir/hppa1.1-hp-hpux10.20/./libgfortran/.libs -L/xxx/gnu/gcc/objdir/hppa1.1-hp-hpux10.20/./libiberty -lm -o ./ nan_3.exe (timeout = 600) PASS: gfortran.dg/nan_3.f90 -O0 (test for excess errors)Setting LD_LIBRARY_PATH to .:/xxx/gnu/gcc/objdir/hppa1.1-hp-hpux10.20/./libgfortran/.libs:/xxx/gnu/gcc/objdir/hppa1.1-hp-hpux10.20/./libgfortran/.libs:/xxx/gnu/gcc/objdir/gcc:.:/xxx/gnu/gcc/objdir/hppa1.1-hp-hpux10.20/./libgfortran/.libs:/xxx/gnu/gcc/objdir/hppa1.1-hp-hpux10.20/./libgfortran/.libs:/xxx/gnu/gcc/objdir/g cc FAIL: gfortran.dg/nan_3.f90 -O0 execution test
Breakpoint 5, MAIN__ () at /xxx/gnu/gcc/gcc/gcc/testsuite/gfortran.dg/nan_3.f90:17 17 if (.not.isnan(r)) call abort() (gdb) p r $1 = 0 (gdb) ptype r type = real(kind=4) (gdb) p/f r $2 = 0 (gdb) step _gfortran_abort () at ../../../gcc/libgfortran/intrinsics/abort.c:38 38 close_units ();
The problem is the use of strtod in convert_real. Unfortunately, strtod does not return correct values for nan, inf and infinity on hpux10. This was fixed in hpux11.
*** Bug 35666 has been marked as a duplicate of this bug. ***
The solution to this issue would be to detect a broken strtod() (or strtof() or strtold()) in libgfortran configury, and write a wrapper checking for infinities and nans before calling the system's strtod(). Very low priority issue because HP-UX 10 is probably not that common any more (HP-UX 11 was released 12 years ago), unless some other target is affected.
Subject: Re: HP-UX 10 has broken strtod On Sat, 28 Mar 2009, fxcoudert at gcc dot gnu dot org wrote: > > > ------- Comment #4 from fxcoudert at gcc dot gnu dot org 2009-03-28 08:55 ------- > The solution to this issue would be to detect a broken strtod() (or strtof() or > strtold()) in libgfortran configury, and write a wrapper checking for > infinities and nans before calling the system's strtod(). Just for the record, I've attached my last version of a change to do this. There was some discussion of this in the following thread: http://gcc.gnu.org/ml/fortran/2008-04/msg00000.html I ran out of time to work on it when the new register allocator was added and the hppa port broke. Dave
Created attachment 17556 [details] pr35667.d
Author: danglin Date: Sat Mar 19 17:25:18 2011 New Revision: 171182 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=171182 Log: PR fortran/35667 * io/io.h (convert_infnan): Declare. * io/read.c (convert_infnan): New. (read_f): Use convert_infnan to convert INFs and NANs. * list_read.c (parse_real, read_real): Likewise. Modified: trunk/libgfortran/ChangeLog trunk/libgfortran/io/io.h trunk/libgfortran/io/list_read.c trunk/libgfortran/io/read.c
Was that fixed with John's commit?
On 12/9/2013 5:01 AM, fxcoudert at gcc dot gnu.org wrote: > Was that fixed with John's commit? I think so. I believe this was left open because the patch wasn't back ported. I could confirm but that would take awhile. Dave
> > Was that fixed with John's commit? > I think so. I believe this was left open because the patch wasn't > back ported. The patch was committed in 4.6 or 4.7 (3 years ago), so the back porting issue in now moot. Closing as FIXED.