bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#5754: Bytecomp Arithmetic test failed


From: Juri Linkov
Subject: bug#5754: Bytecomp Arithmetic test failed
Date: Thu, 25 Mar 2010 09:19:11 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (x86_64-pc-linux-gnu)

> I tried to run some tests in the `test' subdir,
> and `bytecomp-testsuite-run' in `test/bytecomp-testsuite.el' fails
> on one test: (let ((a (expt 2 -1074)) (b 0.125)) (* a 8 b))
> returns 5e-324 when evaluated by interpreter,
> but after byte-compilation returns 0.0

This bug is caused by optimization in byte-compilation
that changes the order of function arguments.

It byte-compiles

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

to

0       constant  expt
1       constant  2
2       constant  -1074
3       call      2
4       constant  0.125
5       varbind   b
6       varbind   a
7       constant  *
8       varref    a
9       varref    b
10      constant  8
11      call      3
12      unbind    2
13      return

where the order of arguments 8-10 is changed from (* a 8 b) to (* a b 8)

For this test the different order of arguments changes
the returned value:

(funcall '* 5e-324 8 0.125)
=> 5e-324

(funcall '* 5e-324 0.125 8)
=> 0.0

-- 
Juri Linkov
http://www.jurta.org/emacs/






reply via email to

[Prev in Thread] Current Thread [Next in Thread]