Subject: Re: Bytecomp Arithmetic test failed

From: Chong Yidong <[email-masked]>
Date: Sat, 03 Apr 2010 19:31:57 -0400

Juri Linkov <[email-masked]> writes:

> Does (let ((a (expt 2 -1074)) (b 0.125)) (* a b 8))
> return 5e-324 when you compile with CFLAGS="-g -O2"?

With CFLAGS="-g -O2",

  (let ((a (expt 2 -1074)) (b 0.125)) (* a b 8))
     => 5e-24

  (eval '(let ((a (expt 2 -1074)) (b 0.125)) (* a 8 b)))
     => 5e-324

  (funcall (byte-compile
    (list 'lambda nil
      (quote (let ((a (expt 2 -1074)) (b 0.125)) (* a 8 b))))))
     => 5e-24

With CFLAGS="-g",

  (let ((a (expt 2 -1074)) (b 0.125)) (* a b 8))
     => 0.0

  (eval '(let ((a (expt 2 -1074)) (b 0.125)) (* a 8 b)))
     => 5e-324

  (funcall (byte-compile
    (list 'lambda nil
      (quote (let ((a (expt 2 -1074)) (b 0.125)) (* a 8 b))))))
     => 0.0

The latter two are what cause bytecomp-testsuite to fail.