From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#5754: Bytecomp Arithmetic test failed Date: Sun, 04 Apr 2010 01:18:17 +0300 Organization: JURTA Message-ID: <8739zcchpq.fsf@mail.jurta.org> References: <87ocifjx74.fsf@mail.jurta.org> <87k4t027r0.fsf@mail.jurta.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1270333584 7473 80.91.229.12 (3 Apr 2010 22:26:24 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 3 Apr 2010 22:26:24 +0000 (UTC) To: 5754@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Apr 04 00:26:20 2010 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1NyBnH-0001pv-9q for geb-bug-gnu-emacs@m.gmane.org; Sun, 04 Apr 2010 00:26:19 +0200 Original-Received: from localhost ([127.0.0.1]:58403 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NyBnG-0003dK-N1 for geb-bug-gnu-emacs@m.gmane.org; Sat, 03 Apr 2010 18:26:18 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NyBmx-0003ZA-PC for bug-gnu-emacs@gnu.org; Sat, 03 Apr 2010 18:25:59 -0400 Original-Received: from [140.186.70.92] (port=60308 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NyBmt-0003Yi-9V for bug-gnu-emacs@gnu.org; Sat, 03 Apr 2010 18:25:59 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NyBmr-0002LT-Lp for bug-gnu-emacs@gnu.org; Sat, 03 Apr 2010 18:25:55 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:49690) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NyBmr-0002LP-Jf for bug-gnu-emacs@gnu.org; Sat, 03 Apr 2010 18:25:53 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1NyBk5-00006H-PQ; Sat, 03 Apr 2010 18:23:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 03 Apr 2010 22:23:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 5754 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 5754-submit@debbugs.gnu.org id=B5754.1270333345379 (code B ref 5754); Sat, 03 Apr 2010 22:23:01 +0000 Original-Received: (at 5754) by debbugs.gnu.org; 3 Apr 2010 22:22:25 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NyBjU-000060-Di for submit@debbugs.gnu.org; Sat, 03 Apr 2010 18:22:24 -0400 Original-Received: from smtp-out1.starman.ee ([85.253.0.3] helo=mx1.starman.ee) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NyBjS-00005p-Jy for 5754@debbugs.gnu.org; Sat, 03 Apr 2010 18:22:23 -0400 X-Virus-Scanned: by Amavisd-New at mx1.starman.ee Original-Received: from mail.starman.ee (82.131.28.129.cable.starman.ee [82.131.28.129]) by mx1.starman.ee (Postfix) with ESMTP id 26DC53F40A5 for <5754@debbugs.gnu.org>; Sun, 4 Apr 2010 01:22:13 +0300 (EEST) In-Reply-To: <87k4t027r0.fsf@mail.jurta.org> (Juri Linkov's message of "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) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Sat, 03 Apr 2010 18:23:01 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:35903 Archived-At: > 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/