[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: isnanl failure on MirBSD
From: |
Eric Blake |
Subject: |
Re: isnanl failure on MirBSD |
Date: |
Mon, 13 Sep 2010 14:29:15 -0600 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.9) Gecko/20100907 Fedora/3.1.3-1.fc13 Mnenhy/0.8.3 Thunderbird/3.1.3 |
On 09/13/2010 02:08 PM, Eric Blake wrote:
Bruno, what else do you need to help debug this? It's crashing on an
i686 installation of the most recent MirBSD (version 10, 20100815),
using mgcc 3.4.6 (propolice; gpc; MirOS 0AAB). I don't yet know whether
to suspect a compiler error, a buggy <float.h>, or faulty configure
results; but this failure in turn means that vasprintf-posix fails.
$ grep '^#.#EXPBIT' config.log
#define FLT_EXPBIT0_WORD 0
#define FLT_EXPBIT0_BIT 23
#define LDBL_EXPBIT0_WORD 2
#define LDBL_EXPBIT0_BIT 0
$ gdb gltests/test-isnanl-nolibm
...
99 exponent = (m.word[EXPBIT0_WORD] >> EXPBIT0_BIT) & EXP_MASK;
(gdb) p m
$1 = {value = 3.1410000000000000142108547152020037, word = {790273982,
3372623069, 16384}}
...
> (gdb) p sizeof (long double)
> 12
Also, EXP_MASK is 2047 (0x7ff).
Some interesting comparisons with Linux:
(gdb) p m
$1 = {value = 3.1409999999999999998993860383933452, word = {790273982,
3372623069, 16384, 0}}
(gdb) p sizeof(long double)
$2 = 16
(Obviously some rounding differences between the two builds of gdb in
how to display the long double, but the value is identical).
EXP_MASK is 32767 (0x7fff).
Therefore, the bug lies in MirBSD's <float.h>. Sure enough, on Linux:
$ printf '#include <float.h>\nLDBL_MAX_EXP LDBL_MIN_EXP\n' | gcc -E - \
| tail -n1
16384 (-16381)
But on MirBSD:
$ printf '#include <float.h>\nLDBL_MAX_EXP LDBL_MIN_EXP\n' | mgcc -E - \
| tail -n1
1024 (-1021)
--
Eric Blake address@hidden +1-801-349-2682
Libvirt virtualization library http://libvirt.org