newlib-1.8.1 bug
Kai Ruottu
karuottu@freenet.hut.fi
Fri Jul 24 07:21:00 GMT 1998
Hi,
I thought to update my newlib-1.8.0-based ppc-eabi-target libs to
newlib-1.8.1. So I built them first with an up-to-date gcc-2.8.1
snapshot (980513), found weird printf() output from my normal test
routine, 'testprintf.c', from the glibc-1.0.9 sources, and tried
with the other ppc-eabi-target compilers I have (egcs-1.0.3, 2.8.1,
2.7.2-970404)...
But for every combination of all the compilers & newlib compiled
with any of these, I got the same results... Building newlib-1.8.0
with any of these gave an acceptable output with all the compilers
however. So, a new bug seem to be invented to newlib-1.8.1 ;-)
I used the 'psim' simulator to check the compilers & libs.
Here are the non-working cases extracted to a test program :
---------------------------
#include <stdio.h>
#include <float.h>
int
main()
{
double d = FLT_MIN;
printf ("%.17e\n", d / 2);
printf("g-style big:\t\"%.60g\"\n", 1e20);
printf ("%15.5e\n", 4.9406564584124654e-324);
exit (0);
}
------------------------------------
The newlib-1.8.0 output (right?) :
---------------------------------------
5.87747175411143754e-39
g-style big: "100000000000000000000"
4.94066e-324
---------------------------------------
and the newlib-1.8.1 output :
---------------------------------------
7.71322248847063567e-39
g-style big: "096833364535605198848"
0.00000e+2147483646
---------------------------------------
Has someone already found a fix to this, or should I
start try to track it...
Those having built newlib-1.8.1 for some other targets: Does
this program work with your system? (I'll look this with
other targets too...)
Regards, Kai
More information about the crossgcc
mailing list