GNU bug report logs - #5754
Bytecomp Arithmetic test failed

Previous Next

Package: emacs;

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 #37 received at 5754 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> jurta.org>
To: 5754 <at> debbugs.gnu.org
Subject: Re: bug#5754: Bytecomp Arithmetic test failed
Date: Sun, 04 Apr 2010 01:18:17 +0300
> 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

`byte-optimize-plus' and `byte-optimize-minus' avoid this problem
by not using `byte-optimize-delay-constants-math' (see how its call
is commented out in `byte-opt.el').  Maybe `byte-optimize-multiply'
and `byte-optimize-divide' should do the same?

=== modified file 'lisp/emacs-lisp/byte-opt.el'
--- lisp/emacs-lisp/byte-opt.el	2010-01-13 08:35:10 +0000
+++ lisp/emacs-lisp/byte-opt.el	2010-04-03 22:16:20 +0000
@@ -806,7 +806,8 @@ (defun byte-optimize-minus (form)
   (byte-optimize-predicate form))
 
 (defun byte-optimize-multiply (form)
-  (setq form (byte-optimize-delay-constants-math form 1 '*))
+  ;; Don't call `byte-optimize-delay-constants-math' (bug#1334, bug#5754).
+  ;; (setq form (byte-optimize-delay-constants-math form 1 '*))
   ;; For (* constants..), byte-optimize-predicate does the work.
   (when (memq nil (mapcar 'numberp (cdr form)))
     ;; After `byte-optimize-predicate', if there is a INTEGER constant
@@ -823,7 +824,8 @@ (defun byte-optimize-multiply (form)
   (byte-optimize-predicate form))
 
 (defun byte-optimize-divide (form)
-  (setq form (byte-optimize-delay-constants-math form 2 '*))
+  ;; Don't call `byte-optimize-delay-constants-math' (bug#1334, bug#5754).
+  ;; (setq form (byte-optimize-delay-constants-math form 2 '*))
   ;; After `byte-optimize-predicate', if there is a INTEGER constant
   ;; in FORM, it is in the last element.
   (let ((last (car (reverse (cdr (cdr form))))))

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




This bug report was last modified 13 years and 170 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.