This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
RE: gcc compiler bug
- To: alan at linuxcare dot com dot au
- Subject: RE: gcc compiler bug
- From: Dale Williamson <Dale dot Williamson at trw dot com>
- Date: Thu, 1 Jun 2000 14:22:03 -0700
- Cc: bug-gcc at gnu dot org, Al Danial <Al dot Danial at trw dot com>
On Wed, 31 May 2000, Alan Modra wrote:
=>I think you need to read an 80x87 programmer's reference. :-)
=>
=>Hint: The first two bit patterns you're playing with are NaNs.
=>
=>--
=>Linuxcare. Support for the Revolution.
On Thu, 1 June 2000, Dale Williamson replies:
Are you hinting that "playing with NaNs" is dangerous? Nothing
could be further from the truth. One needs only view bits and
bytes from a wider perspective to discover the value--in fact, the
revolutionary value--in bit patterns, including ones like NaNQ,
NaNS, INF and their complements -NaNQ, -NaNS, -INF and a host of
others too numerous to mention. :-)
Rereading my 80x87 reference manual probably won't help here be-
cause the issue is one of compilers and uniform behavior of code
--code that should operate uniformly on numerous platforms of
which the x86 is just one.
Just to move 64 bits from one place to another, implementors of C
compilers are free to choose not to pass these 64 bits through an
x87 register that will widen them to 80 bits and meddle with them
before it spits them out.
Most should expect that when a program says X=Y, X will equal Y,
bit for bit, even if Y=NaNQ.
This certainly looks like a bug:
- it works differently under two versions of gcc
- it does not appear on other platforms where gcc compilers
operate