Subject: Re: bug#5754: Bytecomp Arithmetic test failed

From: Andreas Schwab <[email-masked]>
Date: Sun, 04 Apr 2010 10:05:03 +0200

Chong Yidong <[email-masked]> writes:

> The key is that if I compile Emacs with CFLAGS="-g", then
>
> (funcall
>  (byte-compile
>   (list 'lambda nil
> 	(quote (let ((a (expt 2 -1074)) (b 0.125)) (* a 8 b))))))
>
> returns 0.0.  If I compile Emacs with CFLAGS="-g -O2", then it returns
> 5e-324.
>
> It looks like this may be a compiler bug.

It's most likely the effect of excess precision, due to floating point
values being held in registers instead of reloaded from memory.  Try
-ffloat-store.

Andreas.

-- 
Andreas Schwab, [email-masked]
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."