------- Comment #4 from dave at hiauly1 dot hia dot nrc dot ca  2007-08-10 
00:41 -------
Subject: Re:  FAIL: gfortran.fortran-torture/execute/nan_inf_fmt.f90 execution

> Still can't reproduce this on hppa2.0w-hp-hpux11.31. I'm starting to think 
> that
> printf might be broken there, after all. Since it's a corner case on a 
> platform
> that is not the current one, I'd like to close it as WONTFIX, John, what do 
> you
> think?

I just happened to have an old build of 4.2.0 lying around.  The failure
is caused by a segmentation fault:

Program received signal SIGSEGV, Segmentation fault.
0x328a8 in atoi () at lib2funcs.asm:77
77      lib2funcs.asm: No such file or directory.
Current language:  auto; currently asm
(gdb) bt
#0  0x328a8 in atoi () at lib2funcs.asm:77
#1  0x1d5a4 in output_float (dtp=0x7b03b2c0, f=0x4001bd10, value=-nan)
    at ../../../gcc/libgfortran/io/write.c:557
#2  0x1dfbc in write_float (dtp=0x0, f=0x0,
    source=0x7b03b950 "\004üGÙ{\003¸&{\003·ø\006\002ÿÿ", len=2063841318)
    at ../../../gcc/libgfortran/io/write.c:973
#3  0xdcf0 in formatted_transfer (dtp=0x7b03b2c0, type=BT_REAL, p=0x7b03b950,
    kind=4, size=4, nelems=1) at ../../../gcc/libgfortran/io/transfer.c:1086
#4  0xc5c8 in *_gfortran_transfer_real (dtp=0x7b03b2c0, p=0x7b03b290, kind=4)
    at ../../../gcc/libgfortran/io/transfer.c:1369
#5  0x9d74 in MAIN__ ()
    at
/xxx/gnu/gcc/gcc/gcc/testsuite/gfortran.fortran-torture/execute/nan_inf_fmt.f90:19
#6  0xae3c in main (argc=1, argv=0x7b03b048)
    at ../../../gcc/libgfortran/fmain.c:18

The 11.11 manpage for printf says:

      The e, f, and g conversions will print inf for infinity and nan for
      both quiet and signaling NaN values.

The 10.20 manpage doesn't say anything about this but sprintf returned
"+inf" followed by ' ' 42 times.  Obviously, somewhat broken...  However,
output_float doesn't seem to handle returns of inf or nan.

Dave


-- 


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

Reply via email to