gcc compiler bug

Dale Williamson Dale.Williamson@trw.com
Thu Jun 1 14:22:00 GMT 2000


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




More information about the Gcc-bugs mailing list