all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@jurta.org>
To: 5754@debbugs.gnu.org
Subject: bug#5754: Bytecomp Arithmetic test failed
Date: Sun, 04 Apr 2010 01:18:17 +0300	[thread overview]
Message-ID: <8739zcchpq.fsf@mail.jurta.org> (raw)
In-Reply-To: <87k4t027r0.fsf@mail.jurta.org> (Juri Linkov's message of "Thu, 25 Mar 2010 09:19:11 +0200")

> 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/






  parent reply	other threads:[~2010-04-03 22:18 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-23  7:47 bug#5754: Bytecomp Arithmetic test failed Juri Linkov
2010-03-23  8:38 ` Lennart Borgman
2010-03-23  9:03   ` Juri Linkov
2010-03-23 13:31     ` Lennart Borgman
2010-03-24 22:15       ` Chong Yidong
2010-03-24 22:52         ` Lennart Borgman
2010-03-25  1:15           ` Stefan Monnier
2010-03-25  1:19             ` Lennart Borgman
2010-03-25  7:19 ` Juri Linkov
2010-03-30 16:08   ` Juri Linkov
2010-04-03 22:18   ` Juri Linkov [this message]
2010-04-03 22:40 ` Chong Yidong
2010-04-03 22:54   ` Juri Linkov
2010-04-03 23:31     ` Chong Yidong
2010-04-04  6:25   ` Eli Zaretskii
2010-04-04  8:05   ` Andreas Schwab

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8739zcchpq.fsf@mail.jurta.org \
    --to=juri@jurta.org \
    --cc=5754@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.