GNU bug report logs -
#5754
Bytecomp Arithmetic test failed
Previous Next
Reported by: Juri Linkov <juri <at> jurta.org>
Date: Tue, 23 Mar 2010 07:52:02 UTC
Severity: normal
Done: Chong Yidong <cyd <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
Message #29 received at 5754 <at> debbugs.gnu.org (full text, mbox):
> 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/
This bug report was last modified 13 years and 169 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.