[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Test results for m4-1.4.9b

From: Gary V. Vaughan
Subject: Re: Test results for m4-1.4.9b
Date: Sun, 3 Jun 2007 15:12:00 +0100

Hi Bruno,

On 3 Jun 2007, at 02:03, Bruno Haible wrote:
Gary V. Vaughan wrote:
powerpc-apple-darwin8.9.0:      2 failed gnulib tests

Cannot reproduce on powerpc-apple-darwin7.9.0. Which compiler and optimization
flags did you use?

Gcc from Apple's Xcode package as shipped on my Tiger installation DVD:

  $ gcc --version
powerpc-apple-darwin8-gcc-4.0.1 (GCC) 4.0.1 (Apple Computer, Inc. build 5250)
  Copyright (C) 2005 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Standard configure optimisation flags from m4's configure: '-- std=gnu99 -g -O2'

Inserting test-frexpl.c:163:
      fprintf (stderr, "%lg == 0.505L\n", mantissa);

Still, this doesn't help much. Can you print 40 decimal places of the number
(or the exact binary contents, via %LA)?

mantissa = 0X2.051EB851EB851EB851EB851EB8P-2

  0.505 == 1.06581e-16 (my_ldexp (0.505, - -1135314207))
  test-printf-frexpl.c:115: assertion failed

The numbers 1.06581e-16 and -1135314207 don't give any clue.

It smells either like a 'long double' returning function was being called without being properly declared, or like dangerous compiler optimizations.

Not the latter in this case. It looks as though the compiler optimised away the correct values in the output above, so I recompiled with CFLAGS=- ggdb3 and ran through gdb. Here's a (hopefully more useful) typescript from what
seems like an appropriate point in the code:

Breakpoint 1, main () at test-printf-frexpl.c:114
114           ASSERT (mantissa == my_ldexp (x, - exp));
(gdb) p exp
$6 = -969
(gdb) s
my_ldexp (x=1.0121050218045312617883299999606451e-292, d=969) at test- printf-frexpl.c:55
55        for (; d > 0; d--)
(gdb) n
56          x *= 2.0L;
(gdb) l
52      static long double
53      my_ldexp (long double x, int d)
54      {
55        for (; d > 0; d--)
56          x *= 2.0L;
57        for (; d < 0; d++)
58          x *= 0.5L;
59        return x;
60      }
(gdb) fin
Run till exit from #0 my_ldexp (x=1.0121050218045312617883299999606451e-292, d=969) at test-printf- frexpl.c:56
0x00003048 in main () at test-printf-frexpl.c:114
114           ASSERT (mantissa == my_ldexp (x, - exp));
Value returned is $7 = 0.50500000000000000444089209850062616
(gdb) p mantissa
$8 = 0.50499999999999989341858963598497212
(gdb) n
test-printf-frexpl.c:114: assertion failed

Program received signal SIGABRT, Aborted.
0x9004822c in kill ()

Rounding error?

  ())_.              Email me: address@hidden
  ( '/           Read my blog: http://blog.azazil.net
  / )=         ...and my book: http://sources.redhat.com/autobook
`(_~)_ Join my AGLOCO Network: http://www.agloco.com/r/BBBS7912

Attachment: PGP.sig
Description: This is a digitally signed message part

reply via email to

[Prev in Thread] Current Thread [Next in Thread]