This is the mail archive of the newlib@sourceware.cygnus.com mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

newlib-1.8.1 bug?


Just FYI, this was posted to the crossgcc list. I haven't tried to reproduce
it (I haven't got the ppc toolchain handy), so it may be a local user
problem. The only slightly relevant thing I found in the ChangeLog between
1.8.0 and 1.8.1 was:

Wed May 27 13:54:51 1998  Jeffrey A Law  (law@cygnus.com)

      * libc/stdlib/dtoa.c (_dtoa_r): Use "double_union" for variables
      which are accessed as both doubles and integers.
      * libc/stdlib/mprec.c (ulp, b2d, ratio): Likewise.
      * libc/stdlib/strtod.c (_strtod_r): Likewise.
      * libc/stdlib/mprec.h: Add "union double_union" and change
      word0/word1 macros to use it.

HTH,

Jifl

> Subject: newlib-1.8.1 bug
> Date: Fri, 24 Jul 1998 17:16:43 +0000
> From: "Kai Ruottu" <karuottu@freenet.hut.fi>
> Organization: Freenet Finland
> To: crossgcc@cygnus.com
> 
> 
> 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

-- 
Cygnus Solutions, 35 Cambridge Place, Cambridge, UK.  Tel: +44 (1223) 728762
"Woman marry hoping their husbands will change, men||Home e-mail: jifl @ 
marry hoping their wives never do. Neither happen!"||     jifvik.demon.co.uk
Help fight spam! http://spam.abuse.net/  These opinions are all my own fault