From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Newsgroups: gmane.emacs.bugs Subject: bug#42597: 27.1; (+ -0.0) returns +0.0 when compiled Date: Wed, 29 Jul 2020 14:07:32 +0200 Message-ID: <1A998EAD-92A5-42FD-B382-33C0FE2A7D20@acm.org> Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.15\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10347"; mail-complaints-to="usenet@ciao.gmane.io" To: 42597@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jul 29 14:41:20 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k0lOa-0002b9-As for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 29 Jul 2020 14:41:20 +0200 Original-Received: from localhost ([::1]:33972 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k0lOZ-00014Z-BY for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 29 Jul 2020 08:41:19 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58372) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k0lOI-00014L-Ec for bug-gnu-emacs@gnu.org; Wed, 29 Jul 2020 08:41:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:48760) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k0lOI-0002sR-57 for bug-gnu-emacs@gnu.org; Wed, 29 Jul 2020 08:41:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1k0lOI-0007nW-1p for bug-gnu-emacs@gnu.org; Wed, 29 Jul 2020 08:41:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 29 Jul 2020 12:41:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 42597 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.159602642829926 (code B ref -1); Wed, 29 Jul 2020 12:41:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 29 Jul 2020 12:40:28 +0000 Original-Received: from localhost ([127.0.0.1]:60306 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k0lNk-0007mc-57 for submit@debbugs.gnu.org; Wed, 29 Jul 2020 08:40:28 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:36422) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k0lNi-0007mV-Uh for submit@debbugs.gnu.org; Wed, 29 Jul 2020 08:40:27 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58234) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k0lNi-00010l-HW for bug-gnu-emacs@gnu.org; Wed, 29 Jul 2020 08:40:26 -0400 Original-Received: from mail1445c50.megamailservers.eu ([91.136.14.45]:38016 helo=mail265c50.megamailservers.eu) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k0lNg-0002jc-AK for bug-gnu-emacs@gnu.org; Wed, 29 Jul 2020 08:40:26 -0400 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1596024454; bh=P6GW5D3h0ztlRiDWrd9zOXGhSqurWLTAXgYyeyADKM8=; h=From:Subject:Date:To:From; b=KrLW04ImXIT6QdoComUiA3NPn2yeZLermWLWq9fZToBHTW2z4arLZphntSK6t/gzv ahdU3HuDC/yyhN6075X2vahtX+z1kBnX7iKeOZt6vDLZ2LVwcu107nRKghtultv+bz VJZlb+gMfYrXdqg4Pz0MNDJLP7qYCAGN/oo2M/HA= Feedback-ID: mattiase@acm.or Original-Received: from stanniol.lan (c-4e4ae655.032-75-73746f71.bbcust.telenor.se [85.230.74.78]) (authenticated bits=0) by mail265c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id 06TC7WS9024516 for ; Wed, 29 Jul 2020 12:07:34 +0000 X-Mailer: Apple Mail (2.3445.104.15) X-CTCH-RefID: str=0001.0A782F22.5F216686.00DB:SCFSTAT68638221, ss=1, re=-4.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-CTCH-VOD: Unknown X-CTCH-Spam: Unknown X-CTCH-Score: -4.000 X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-CSC: 0 X-CHA: v=2.3 cv=D5w51cZj c=1 sm=1 tr=0 a=klNLuyVZdLUgl+K5Uafb2A==:117 a=klNLuyVZdLUgl+K5Uafb2A==:17 a=IkcTkHD0fZMA:10 a=M51BFTxLslgA:10 a=jQezuzW7sWxOfOmvXQkA:9 a=QEXdDO2ut3YA:10 Received-SPF: softfail client-ip=91.136.14.45; envelope-from=mattiase@acm.org; helo=mail265c50.megamailservers.eu X-detected-operating-system: by eggs.gnu.org: First seen = 2020/07/29 08:07:35 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x (no timestamps) [generic] X-Spam_score_int: -11 X-Spam_score: -1.2 X-Spam_bar: - X-Spam_report: (-1.2 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, SPF_HELO_NONE=0.001, SPF_SOFTFAIL=0.665, URIBL_BLOCKED=0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:183655 Archived-At: Unary +, *, min and max, all of which should be identity for numbers, = convert -0.0 to +0.0 when byte-compiled: (defun f (x) (+ x)) (f -0.0) =3D> -0.0 (byte-compile 'f) (f -0.0) =3D> 0.0 The reason is that byte-compile-associative transforms (+ x), (* x), = (min x) and (max x) into (+ x 0). No patch yet (sorry!) but I'm not sure what would be the best way to go = about it. Some possibilities: A. Use a full 1-argument call, like (+ x). This is more expensive (about = 1.8=C3=97) since the general function call mechanism has to be used. B. Use (* x 1) instead; this appears to work. This is also more = expensive (1.6=C3=97); not sure why. C. Add a new byte-op. Fast but probably overkill. Better suggestions welcome!