[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug classpath/28096] parseFloat and parseDouble faulty on small numbers
From: |
aph at gcc dot gnu dot org |
Subject: |
[Bug classpath/28096] parseFloat and parseDouble faulty on small numbers. |
Date: |
9 Sep 2006 17:19:57 -0000 |
------- Comment #7 from aph at gcc dot gnu dot org 2006-09-09 17:19 -------
It's definitely being miscompiled. Here's a test case:
#include <stdio.h>
#include "/mnt/zebedee/gcc/trunk/libjava/classpath/native/fdlibm/mprec.h"
int main ()
{
const char *s = "5e-324";
struct _Jv_reent poo;
memset (&poo, 0, sizeof poo);
char *se;
double d = _strtod_r (&poo, s, &se);
fprintf(stdout, "%g\n", d);
return 0;
}
$ /local/install/bin/gcc p.c -I/mnt/zebedee/gcc/trunk/libjava/inlcude
-I/mnt/zebedee/gcc/trunk/libjava/classpath/native/
-I/local/trunk/obj-i686-pc-linux-gnu/i686-pc-linux-gnu/libjava/include/
-I/local/trunk/obj-i686-pc-linux-gnu/i686-pc-linux-gnu/libjava/classpath/include
-lgcj
$ LD_LIBRARY_PATH=/local/install/lib ./a.out
-1.061e-314
Recompile strtod at -O1 and it's fine:
$ /local/install/bin/gcc p.c -I/mnt/zebedee/gcc/trunk/libjava/inlcude
-I/mnt/zebedee/gcc/trunk/libjava/classpath/native/
-I/local/trunk/obj-i686-pc-linux-gnu/i686-pc-linux-gnu/libjava/include/
-I/local/trunk/obj-i686-pc-linux-gnu/i686-pc-linux-gnu/libjava/classpath/include
-lgcj /home/aph/gcc/trunk/libjava/classpath/native/fdlibm/strtod.c -O1
$ LD_LIBRARY_PATH=/local/install/lib ./a.out
4.94066e-324
--
aph at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Last reconfirmed|2006-06-21 14:22:34 |2006-09-09 17:19:57
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28096