Hi Bruno! Thanks for the quick reply!
On Sat, Apr 12, 2008 at 07:33:14PM +0200, Bruno Haible wrote: > Hi, > > Thomas Klausner reported: > > | m4-1.4.11 fails two selftests on NetBSD-4.99.48/amd64. > > | The first one is in test-frexpl: > > | > > | # gdb test-frexpl test-frexpl.core > > | GNU gdb 6.5 > > | Copyright (C) 2006 Free Software Foundation, Inc. > > ... > > | Core was generated by `test-frexpl'. > > | Program terminated with signal 6, Aborted. > > | #0 0x00007f7ffd93269a in kill () from /usr/lib/libc.so.12 > > | (gdb) bt > > | #0 0x00007f7ffd93269a in kill () from /usr/lib/libc.so.12 > > | #1 0x00007f7ffd9d7a99 in abort () from /usr/lib/libc.so.12 > > | #2 0x00000000004013ae in main () at test-frexpl.c:166 > > | (gdb) fr 2 > > | #2 0x00000000004013ae in main () at test-frexpl.c:166 > > | 166 ASSERT (mantissa == 0.505L); > > | (gdb) p mantissa > > | $1 = 0.505 > > Can you provide two more bits of information: > - In gdb of this test, compiled with CFLAGS=-g (no optimization): > print mantissa > print i > print x > print *(void*(*)[4])&mantissa > print *(void*(*)[4])&x (gdb) print mantissa $1 = 0.505 (gdb) print i $2 = 1 (gdb) print x $3 = 1.01 (gdb) print *(void*(*)[4])&mantissa $4 = {0x8147ae147ae14800, 0x7f7ffdb13ffe, 0x0, 0x7f7ffdb10040} (gdb) print *(void*(*)[4])&x $5 = {0x8147ae147ae147ae, 0x3fff, 0xc000000000000000, 0xffff} > - What is the expansion of BEGIN_LONG_DOUBLE_ROUNDING resulting from > fpucw.h? You can see this by looking at the output of > "gcc ... -E -dM test-frexpl.c". cc -std=gnu99 -I. -I../lib -I. -I. -I.. -I./.. -I../lib -I./../lib -g -O0 -MT test-frexpl.o -MD -MP -MF .deps/test-frexpl.Tpo -E -dM test-frexpl.c gives: #define BEGIN_LONG_DOUBLE_ROUNDING() > Does the failure disappear if you change > the #if test in fpucw.h from __i386__ to __x86_64__ and rebuild? Yes, #if defined __x86_64__ && defined __GNUC__ makes the failure go away. Cheers, Thomas