GNU bug report logs - #42597
27.1; (+ -0.0) returns +0.0 when compiled

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Mattias Engdegård <mattiase@HIDDEN>; Keywords: patch; Done: Mattias Engdegård <mattiase@HIDDEN>; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 42597-done <at> debbugs.gnu.org:


Received: (at 42597-done) by debbugs.gnu.org; 7 Aug 2020 08:52:47 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Aug 07 04:52:47 2020
Received: from localhost ([127.0.0.1]:55675 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1k3y7K-0002Lp-Qd
	for submit <at> debbugs.gnu.org; Fri, 07 Aug 2020 04:52:47 -0400
Received: from mail1442c50.megamailservers.eu ([91.136.14.42]:50802
 helo=mail264c50.megamailservers.eu)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mattiase@HIDDEN>) id 1k3y7I-0002LY-81
 for 42597-done <at> debbugs.gnu.org; Fri, 07 Aug 2020 04:52:45 -0400
X-Authenticated-User: mattiase@HIDDEN
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu;
 s=maildub; t=1596790357;
 bh=Nnxqe4hd3LAQ3Qvw7B70wGw9ES6BXBadKsjDA1ZWiek=;
 h=Subject:From:In-Reply-To:Resent-From:Date:Cc:Resent-Date:
 Resent-To:References:To:From;
 b=WL2ZQ6MK2pfhqt7IjKeYdmxWg7NYnzYiMDXZwz31sEbVwuS4xBSWjUikjxu4h9XJ/
 tS5O1Vo/w1NGEJNC+/1zYFz6v3BPaKHs7n6lIZx+z/yW5nDOPknULIeiM/Aly4P+F6
 /bz9xr9W6rbKF01dzA3IdeEe6Ib1boVwQYsY1MG4=
Feedback-ID: mattiase@HIDDEN
Received: from [192.168.0.4] (c188-150-171-71.bredband.comhem.se
 [188.150.171.71]) (authenticated bits=0)
 by mail264c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id 0778qZ4R001795
 for <42597-done <at> debbugs.gnu.org>; Fri, 7 Aug 2020 08:52:37 +0000
Resent-Message-Id: <202008070852.0778qZ4R001795@HIDDEN>
Subject: Re: bug#42597: 27.1; (+ -0.0) returns +0.0 when compiled
Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.15\))
Content-Type: text/plain;
	charset=us-ascii
From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= <mattiase@HIDDEN>
In-Reply-To: <045AEB54-0FC5-40D8-BC8F-D550670BD2AF@HIDDEN>
Resent-From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= <mattiase@HIDDEN>
Date: Fri, 7 Aug 2020 10:50:19 +0200
Content-Transfer-Encoding: 7bit
Resent-Date: Fri, 7 Aug 2020 10:52:34 +0200
Message-Id: <8E812D2B-DAFD-433F-8A77-44946CD51F4F@HIDDEN>
Resent-To: 42597-done <at> debbugs.gnu.org
References: <20200729133532.21725.qmail@HIDDEN>
 <045AEB54-0FC5-40D8-BC8F-D550670BD2AF@HIDDEN>
To: Alan Mackenzie <acm@HIDDEN>
X-Mailer: Apple Mail (2.3445.104.15)
X-CTCH-RefID: str=0001.0A782F19.5F2D1655.003F, ss=1, re=0.000, recu=0.000,
 reip=0.000, cl=1, cld=1, fgs=0
X-CTCH-VOD: Unknown
X-CTCH-Spam: Unknown
X-CTCH-Score: 0.000
X-CTCH-Rules: 
X-CTCH-Flags: 0
X-CTCH-ScoreCust: 0.000
X-CSC: 0
X-CHA: v=2.3 cv=PPNxBsiC c=1 sm=1 tr=0 a=SF+I6pRkHZhrawxbOkkvaA==:117
 a=SF+I6pRkHZhrawxbOkkvaA==:17 a=kj9zAlcOel0A:10 a=M51BFTxLslgA:10
 a=-jk9e3pworHws16P57UA:9 a=CjuIK1q_8ugA:10 a=pHzHmUro8NiASowvMSCR:22
 a=Ew2E2A-JSTLzCXPT_086:22
X-Origin-Country: SE
X-Spam-Score: 1.4 (+)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview:  No immediate objections at least; patches pushed to master.
 Content analysis details:   (1.4 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 1.0 SPF_SOFTFAIL           SPF: sender does not match SPF record (softfail)
 0.4 KHOP_HELO_FCRDNS       Relay HELO differs from its IP's reverse DNS
X-Debbugs-Envelope-To: 42597-done
Cc: 42597-done@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

No immediate objections at least; patches pushed to master.






Notification sent to Mattias Engdegård <mattiase@HIDDEN>:
bug acknowledged by developer. Full text available.
Reply sent to Mattias Engdegård <mattiase@HIDDEN>:
You have taken responsibility. Full text available.
Added tag(s) patch. Request was from Mattias Engdegård <mattiase@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 42597 <at> debbugs.gnu.org:


Received: (at 42597) by debbugs.gnu.org; 3 Aug 2020 15:51:51 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Aug 03 11:51:51 2020
Received: from localhost ([127.0.0.1]:45914 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1k2ckg-00032V-Uc
	for submit <at> debbugs.gnu.org; Mon, 03 Aug 2020 11:51:51 -0400
Received: from mail179c50.megamailservers.eu ([91.136.10.189]:38720
 helo=mail18c50.megamailservers.eu)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mattiase@HIDDEN>) id 1k2ckb-00032I-5f
 for 42597 <at> debbugs.gnu.org; Mon, 03 Aug 2020 11:51:49 -0400
X-Authenticated-User: mattiase@HIDDEN
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu;
 s=maildub; t=1596469903;
 bh=0iFQ1sL/XAlIWp2Z4z/tsmQdlC18Dri5XHlQ9dwyC+Q=;
 h=Subject:From:Resent-Cc:Resent-From:In-Reply-To:Date:Cc:
 Resent-Date:Resent-To:References:To:From;
 b=je3sV017KZwemCI7/QR4VOFy6f/iGGIgtL5sbJF52/dq2gqtKbBojGwNExW5Vf50z
 OsEFyvNgAglI7MyuOeSuojqEhcZV7IV258e/aQi4sdTX9o4cQjSjGVv8J2SJE8HWWA
 W6Cp+qM/sdhRYFaO/mg8I637XebC5lH/DHXlj33Q=
Feedback-ID: mattiase@HIDDEN
Received: from [192.168.0.4] (c188-150-171-71.bredband.comhem.se
 [188.150.171.71]) (authenticated bits=0)
 by mail18c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id 073FpeUi023414; 
 Mon, 3 Aug 2020 15:51:42 +0000
Resent-Message-Id: <202008031551.073FpeUi023414@HIDDEN>
Subject: Re: bug#42597: 27.1; (+ -0.0) returns +0.0 when compiled
Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.15\))
Content-Type: multipart/mixed;
 boundary="Apple-Mail=_ED3C32FC-7395-4167-8EF0-53313C747201"
From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= <mattiase@HIDDEN>
Resent-Cc: Alan Mackenzie <acm@HIDDEN>
Resent-From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= <mattiase@HIDDEN>
In-Reply-To: <20200729133532.21725.qmail@HIDDEN>
Date: Mon, 3 Aug 2020 17:36:03 +0200
Resent-Date: Mon, 3 Aug 2020 17:51:40 +0200
Message-Id: <045AEB54-0FC5-40D8-BC8F-D550670BD2AF@HIDDEN>
Resent-To: 42597 <at> debbugs.gnu.org
References: <20200729133532.21725.qmail@HIDDEN>
To: Alan Mackenzie <acm@HIDDEN>
X-Mailer: Apple Mail (2.3445.104.15)
X-CTCH-RefID: str=0001.0A782F20.5F28328F.001C, ss=1, re=0.000, recu=0.000,
 reip=0.000, cl=1, cld=1, fgs=0
X-CTCH-VOD: Unknown
X-CTCH-Spam: Unknown
X-CTCH-Score: 0.000
X-CTCH-Rules: 
X-CTCH-Flags: 0
X-CTCH-ScoreCust: 0.000
X-CSC: 0
X-CHA: v=2.3 cv=K8Zc4BeI c=1 sm=1 tr=0 a=SF+I6pRkHZhrawxbOkkvaA==:117
 a=SF+I6pRkHZhrawxbOkkvaA==:17 a=M51BFTxLslgA:10 a=jHXeqeKlcSZx5K_ZZZcA:9
 a=CjuIK1q_8ugA:10 a=Ms0hgN6XpexoEyWL4h0A:9 a=B2y7HmGcmWMA:10
 a=Sqhs8MLHaK0zslS-bRcA:9
X-Origin-Country: SE
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: 42597
Cc: 42597@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)


--Apple-Mail=_ED3C32FC-7395-4167-8EF0-53313C747201
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=us-ascii

29 juli 2020 kl. 15.35 skrev Alan Mackenzie <acm@HIDDEN>:

> This is an example of what happens when ignorant people rule the =
roost.
> -0.0 and +0.0 are identically the same thing.  It should not take a
> degree in mathematics (which I have) to realise this.  When you put
> mathematical nonsense into <whatever thing is producing -0.0> you =
cannot
> help but get nonsense back out.

Thanks Alan -- there are good arguments both for and against negative =
zero and I would happily discuss them over a little glass of something =
once it is possible to meet in person again. Now we don't have much =
choice since IEEE-754 is what it is and we should have very strong =
reasons for making changes that conflict with that standard.

At the very least we should be consistent. The effort is small enough =
(first patch below, I went with the (* x 1) variant).

The code did contain a fair amount of obsolete and/or incorrect comments =
and decisions, some relating to bug#1334 which is no longer relevant =
(Emacs didn't have bignums at the time). Today, the N-arg semantics of =
+, - (except for N=3D1), *, min and max (but notably not /) are =
equivalent to the corresponding left-folds of binary operations, which =
helps a lot. The second patch cleans up and improves optimisation for =
arithmetic operations generally.


--Apple-Mail=_ED3C32FC-7395-4167-8EF0-53313C747201
Content-Disposition: attachment;
	filename=0001-Fix-byte-compilation-of-0.0-bug-42597.patch
Content-Type: application/octet-stream;
	x-unix-mode=0644;
	name="0001-Fix-byte-compilation-of-0.0-bug-42597.patch"
Content-Transfer-Encoding: quoted-printable

=46rom=20793e9252e3e946dd0d70cb5d461f7a29244b8811=20Mon=20Sep=2017=20=
00:00:00=202001=0AFrom:=20=3D?UTF-8?q?Mattias=3D20Engdeg=3DC3=3DA5rd?=3D=20=
<mattiase@HIDDEN>=0ADate:=20Mon,=203=20Aug=202020=2015:29:41=20+0200=0A=
Subject:=20[PATCH=201/2]=20Fix=20byte-compilation=20of=20(+=20-0.0)=20=
(bug#42597)=0A=0A*=20lisp/emacs-lisp/bytecomp.el=20=
(byte-compile-associative):=0ATranslate=20numerical=20identity=20=
expressions,=20such=20as=20(+=20x)=20and=20(*=20x),=0Ainto=20(*=20x=201)=20=
since=20the=20previous=20translation=20(+=20x=200)=20gets=20it=20wrong=0A=
for=20x=20=3D=20-0.0.=0A*=20test/lisp/emacs-lisp/bytecomp-tests.el=0A=
(byte-opt-testsuite-arith-data):=20Add=20test=20cases.=0A---=0A=20=
lisp/emacs-lisp/bytecomp.el=20=20=20=20=20=20=20=20=20=20=20=20|=206=20=
+++---=0A=20test/lisp/emacs-lisp/bytecomp-tests.el=20|=205=20+++++=0A=20=
2=20files=20changed,=208=20insertions(+),=203=20deletions(-)=0A=0Adiff=20=
--git=20a/lisp/emacs-lisp/bytecomp.el=20b/lisp/emacs-lisp/bytecomp.el=0A=
index=2022e648e44b..8f76a3abb9=20100644=0A---=20=
a/lisp/emacs-lisp/bytecomp.el=0A+++=20b/lisp/emacs-lisp/bytecomp.el=0A@@=20=
-3733,7=20+3733,7=20@@=20byte-compile-get-closed-var=0A=20;;=20Compile=20=
a=20function=20that=20accepts=20one=20or=20more=20args=20and=20is=20=
right-associative.=0A=20;;=20We=20do=20it=20by=20left-associativity=20so=20=
that=20the=20operations=0A=20;;=20are=20done=20in=20the=20same=20order=20=
as=20in=20interpreted=20code.=0A-;;=20We=20treat=20the=20one-arg=20case,=20=
as=20in=20(+=20x),=20like=20(+=20x=200).=0A+;;=20We=20treat=20the=20=
one-arg=20case,=20as=20in=20(+=20x),=20like=20(*=20x=201).=0A=20;;=20in=20=
order=20to=20convert=20markers=20to=20numbers,=20and=20trigger=20=
expected=20errors.=0A=20(defun=20byte-compile-associative=20(form)=0A=20=20=
=20(if=20(cdr=20form)=0A@@=20-3748,8=20+3748,8=20@@=20=
byte-compile-associative=0A=20=09=20=20(setq=20args=20(copy-sequence=20=
(cdr=20form)))=0A=20=09=20=20(byte-compile-form=20(car=20args))=0A=20=09=20=
=20(setq=20args=20(cdr=20args))=0A-=09=20=20(or=20args=20(setq=20args=20=
'(0)=0A-=09=09=09=20opcode=20(get=20'+=20'byte-opcode)))=0A+=09=20=20(or=20=
args=20(setq=20args=20'(1)=0A+=09=09=09=20opcode=20(get=20'*=20=
'byte-opcode)))=0A=20=09=20=20(dolist=20(arg=20args)=0A=20=09=20=20=20=20=
(byte-compile-form=20arg)=0A=20=09=20=20=20=20(byte-compile-out=20opcode=20=
0))))=0Adiff=20--git=20a/test/lisp/emacs-lisp/bytecomp-tests.el=20=
b/test/lisp/emacs-lisp/bytecomp-tests.el=0Aindex=20=
c235dd43fc..894914300a=20100644=0A---=20=
a/test/lisp/emacs-lisp/bytecomp-tests.el=0A+++=20=
b/test/lisp/emacs-lisp/bytecomp-tests.el=0A@@=20-47,6=20+47,11=20@@=20=
byte-opt-testsuite-arith-data=0A=20=20=20=20=20(let=20((a=201.0))=09=09=09=
=09=20=20=20(/=203=20a=202))=0A=20=20=20=20=20(let=20((a=20=
most-positive-fixnum)=20(b=202.0))=09=20=20=20(*=20a=202=20b))=0A=20=20=20=
=20=20(let=20((a=203)=20(b=202))=09=09=09=09=20=20=20(/=20a=20b=201.0))=0A=
+=20=20=20=20(let=20((a=20-0.0))=20(+=20a))=0A+=20=20=20=20(let=20((a=20=
-0.0))=20(-=20a))=0A+=20=20=20=20(let=20((a=20-0.0))=20(*=20a))=0A+=20=20=
=20=20(let=20((a=20-0.0))=20(min=20a))=0A+=20=20=20=20(let=20((a=20=
-0.0))=20(max=20a))=0A=20=20=20=20=20(/=203=20-1)=0A=20=20=20=20=20(+=20=
4=203=202=201)=0A=20=20=20=20=20(+=204=203=202.0=201)=0A--=20=0A2.21.1=20=
(Apple=20Git-122.3)=0A=0A=

--Apple-Mail=_ED3C32FC-7395-4167-8EF0-53313C747201
Content-Disposition: attachment;
	filename=0002-Clean-up-and-improve-compilation-of-arithmetic-opera.patch
Content-Type: application/octet-stream;
	x-unix-mode=0644;
	name="0002-Clean-up-and-improve-compilation-of-arithmetic-opera.patch"
Content-Transfer-Encoding: quoted-printable

=46rom=208c1a405b2a39b03d167a744f63ac4c5504b9e9ad=20Mon=20Sep=2017=20=
00:00:00=202001=0AFrom:=20=3D?UTF-8?q?Mattias=3D20Engdeg=3DC3=3DA5rd?=3D=20=
<mattiase@HIDDEN>=0ADate:=20Mon,=203=20Aug=202020=2016:29:06=20+0200=0A=
Subject:=20[PATCH=202/2]=20Clean=20up=20and=20improve=20compilation=20of=20=
arithmetic=20operations=0A=0A(Bug#42597)=0A=0A*=20=
lisp/emacs-lisp/byte-opt.el=20(byte-optimize-associative-math)=0A=
(byte-optimize-min-max):=20Transform=203-arg=20min/max=20call=20to=20two=20=
2-arg=0Acalls,=20which=20is=20faster.=0A*=20lisp/emacs-lisp/bytecomp.el=20=
(byte-compile-associative):=20Rename=20to...=0A=
(byte-compile-variadic-numeric):=20...this=20function=20and=20simplify,=0A=
fixing=20incorrect=20comments.=20=20The=203-arg=20strength=20reduction=20=
is=20now=0Aalways=20done=20in=20the=20optimisers=20and=20is=20no=20=
longer=20needed=20here.=0A(byte-compile-min-max):=20New=20function.=0A=
(byte-compile-minus):=20Simplify,=20remove=20incorrect=20comment,=20and=20=
use=0Abyte-compile-variadic-numeric.=0A(byte-compile-quo):=20Simplify=20=
and=20fix=20comment.=0A---=0A=20lisp/emacs-lisp/byte-opt.el=20|=2029=20=
++++++++----=0A=20lisp/emacs-lisp/bytecomp.el=20|=2093=20=
+++++++++++++++++--------------------=0A=202=20files=20changed,=2062=20=
insertions(+),=2060=20deletions(-)=0A=0Adiff=20--git=20=
a/lisp/emacs-lisp/byte-opt.el=20b/lisp/emacs-lisp/byte-opt.el=0Aindex=20=
0d9c449b3b..4987596bf9=20100644=0A---=20a/lisp/emacs-lisp/byte-opt.el=0A=
+++=20b/lisp/emacs-lisp/byte-opt.el=0A@@=20-648,14=20+648,23=20@@=20=
byte-optimize-associative-math=0A=20=09=20=20(setq=20args=20(cons=20(car=20=
rest)=20args)))=0A=20=20=20=20=20=20=20(setq=20rest=20(cdr=20rest)))=0A=20=
=20=20=20=20(if=20(cdr=20constants)=0A-=09(if=20args=0A-=09=20=20=20=20=
(list=20(car=20form)=0A-=09=09=20=20(apply=20(car=20form)=20constants)=0A=
-=09=09=20=20(if=20(cdr=20args)=0A-=09=09=20=20=20=20=20=20(cons=20(car=20=
form)=20(nreverse=20args))=0A-=09=09=20=20=20=20=20=20(car=20args)))=0A-=09=
=20=20=20=20(apply=20(car=20form)=20constants))=0A-=09form)))=0A+=20=20=20=
=20=20=20=20=20(let=20((const=20(apply=20(car=20form)=20(nreverse=20=
constants))))=0A+=09=20=20(if=20args=0A+=09=20=20=20=20=20=20(append=20=
(list=20(car=20form)=20const)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20(nreverse=20args))=0A+=09=20=20=20=20const))=0A+=20=
=20=20=20=20=20form)))=0A+=0A+(defun=20byte-optimize-min-max=20(form)=0A=
+=20=20"Optimize=20`min'=20and=20`max'."=0A+=20=20(let=20((opt=20=
(byte-optimize-associative-math=20form)))=0A+=20=20=20=20(if=20(and=20=
(consp=20opt)=20(memq=20(car=20opt)=20'(min=20max))=0A+=20=20=20=20=20=20=
=20=20=20=20=20=20=20(=3D=20(length=20opt)=204))=0A+=20=20=20=20=20=20=20=
=20;;=20(OP=20x=20y=20z)=20->=20(OP=20(OP=20x=20y)=20z),=20in=20order=20=
to=20use=20binary=20byte=20ops.=0A+=20=20=20=20=20=20=20=20(list=20(car=20=
opt)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20(list=20(car=20opt)=20=
(nth=201=20opt)=20(nth=202=20opt))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20(nth=203=20opt))=0A+=20=20=20=20=20=20opt)))=0A=20=0A=20;;=20Use=20=
OP=20to=20reduce=20any=20leading=20prefix=20of=20constant=20numbers=20in=20=
the=20list=0A=20;;=20(cons=20ACCUM=20ARGS)=20down=20to=20a=20single=20=
number,=20and=20return=20the=0A@@=20-878,8=20+887,8=20@@=20=
byte-optimize-concat=0A=20(put=20'*=20=20=20'byte-optimizer=20=
#'byte-optimize-multiply)=0A=20(put=20'-=20=20=20'byte-optimizer=20=
#'byte-optimize-minus)=0A=20(put=20'/=20=20=20'byte-optimizer=20=
#'byte-optimize-divide)=0A-(put=20'max=20'byte-optimizer=20=
#'byte-optimize-associative-math)=0A-(put=20'min=20'byte-optimizer=20=
#'byte-optimize-associative-math)=0A+(put=20'max=20'byte-optimizer=20=
#'byte-optimize-min-max)=0A+(put=20'min=20'byte-optimizer=20=
#'byte-optimize-min-max)=0A=20=0A=20(put=20'=3D=20=20=20'byte-optimizer=20=
#'byte-optimize-binary-predicate)=0A=20(put=20'eq=20=20'byte-optimizer=20=
#'byte-optimize-binary-predicate)=0Adiff=20--git=20=
a/lisp/emacs-lisp/bytecomp.el=20b/lisp/emacs-lisp/bytecomp.el=0Aindex=20=
8f76a3abb9..7ae8749ab4=20100644=0A---=20a/lisp/emacs-lisp/bytecomp.el=0A=
+++=20b/lisp/emacs-lisp/bytecomp.el=0A@@=20-3580,10=20+3580,10=20@@=20=
narrow-to-region=0A=20(byte-defop-compiler=20(%=20byte-rem)=092)=0A=20=
(byte-defop-compiler=20aset=09=093)=0A=20=0A-(byte-defop-compiler=20max=09=
=09byte-compile-associative)=0A-(byte-defop-compiler=20min=09=09=
byte-compile-associative)=0A-(byte-defop-compiler=20(+=20byte-plus)=09=
byte-compile-associative)=0A-(byte-defop-compiler=20(*=20byte-mult)=09=
byte-compile-associative)=0A+(byte-defop-compiler=20max=09=09=
byte-compile-min-max)=0A+(byte-defop-compiler=20min=09=09=
byte-compile-min-max)=0A+(byte-defop-compiler=20(+=20byte-plus)=09=
byte-compile-variadic-numeric)=0A+(byte-defop-compiler=20(*=20byte-mult)=09=
byte-compile-variadic-numeric)=0A=20=0A=20;;####(byte-defop-compiler=20=
move-to-column=091)=0A=20(byte-defop-compiler-1=20interactive=20=
byte-compile-noop)=0A@@=20-3730,30=20+3730,36=20@@=20=
byte-compile-get-closed-var=0A=20=20=20(if=20byte-compile--for-effect=20=
(setq=20byte-compile--for-effect=20nil)=0A=20=20=20=20=20=
(byte-compile-out=20'byte-constant=20(nth=201=20form))))=0A=20=0A-;;=20=
Compile=20a=20function=20that=20accepts=20one=20or=20more=20args=20and=20=
is=20right-associative.=0A-;;=20We=20do=20it=20by=20left-associativity=20=
so=20that=20the=20operations=0A-;;=20are=20done=20in=20the=20same=20=
order=20as=20in=20interpreted=20code.=0A-;;=20We=20treat=20the=20one-arg=20=
case,=20as=20in=20(+=20x),=20like=20(*=20x=201).=0A-;;=20in=20order=20to=20=
convert=20markers=20to=20numbers,=20and=20trigger=20expected=20errors.=0A=
-(defun=20byte-compile-associative=20(form)=0A+;;=20Compile=20a=20pure=20=
function=20that=20accepts=20zero=20or=20more=20numeric=20arguments=0A+;;=20=
and=20has=20an=20opcode=20for=20the=20binary=20case.=0A+;;=20=
Single-argument=20calls=20are=20assumed=20to=20be=20numeric=20identity=20=
and=20are=0A+;;=20compiled=20as=20(*=20x=201)=20in=20order=20to=20=
convert=20markers=20to=20numbers=20and=0A+;;=20trigger=20type=20errors.=0A=
+(defun=20byte-compile-variadic-numeric=20(form)=0A+=20=20(pcase=20=
(length=20form)=0A+=20=20=20=20(1=0A+=20=20=20=20=20;;=20No=20args:=20=
use=20the=20identity=20value=20for=20the=20operation.=0A+=20=20=20=20=20=
(byte-compile-constant=20(eval=20form)))=0A+=20=20=20=20(2=0A+=20=20=20=20=
=20;;=20One=20arg:=20compile=20(OP=20x)=20as=20(*=20x=201).=20This=20is=20=
identity=20for=0A+=20=20=20=20=20;;=20all=20numerical=20values=20=
including=20-0.0,=20infinities=20and=20NaNs.=0A+=20=20=20=20=20=
(byte-compile-form=20(nth=201=20form))=0A+=20=20=20=20=20=
(byte-compile-constant=201)=0A+=20=20=20=20=20(byte-compile-out=20(get=20=
'*=20'byte-opcode)=200))=0A+=20=20=20=20(3=0A+=20=20=20=20=20=
(byte-compile-form=20(nth=201=20form))=0A+=20=20=20=20=20=
(byte-compile-form=20(nth=202=20form))=0A+=20=20=20=20=20=
(byte-compile-out=20(get=20(car=20form)=20'byte-opcode)=200))=0A+=20=20=20=
=20(_=0A+=20=20=20=20=20;;=20>2=20args:=20compile=20as=20a=20single=20=
function=20call.=0A+=20=20=20=20=20(byte-compile-normal-call=20form))))=0A=
+=0A+(defun=20byte-compile-min-max=20(form)=0A+=20=20"Byte-compile=20=
calls=20to=20`min'=20or=20`max'."=0A=20=20=20(if=20(cdr=20form)=0A-=20=20=
=20=20=20=20(let=20((opcode=20(get=20(car=20form)=20'byte-opcode))=0A-=09=
=20=20=20=20args)=0A-=09(if=20(and=20(<=203=20(length=20form))=0A-=09=09=20=
(memq=20opcode=20(list=20(get=20'+=20'byte-opcode)=0A-=09=09=09=09=20=20=20=
=20(get=20'*=20'byte-opcode))))=0A-=09=20=20=20=20;;=20Don't=20use=20=
binary=20operations=20for=20>=202=20operands,=20as=20that=0A-=09=20=20=20=
=20;;=20may=20cause=20overflow/truncation=20in=20float=20operations.=0A-=09=
=20=20=20=20(byte-compile-normal-call=20form)=0A-=09=20=20(setq=20args=20=
(copy-sequence=20(cdr=20form)))=0A-=09=20=20(byte-compile-form=20(car=20=
args))=0A-=09=20=20(setq=20args=20(cdr=20args))=0A-=09=20=20(or=20args=20=
(setq=20args=20'(1)=0A-=09=09=09=20opcode=20(get=20'*=20'byte-opcode)))=0A=
-=09=20=20(dolist=20(arg=20args)=0A-=09=20=20=20=20(byte-compile-form=20=
arg)=0A-=09=20=20=20=20(byte-compile-out=20opcode=200))))=0A-=20=20=20=20=
(byte-compile-constant=20(eval=20form))))=0A+=20=20=20=20=20=20=
(byte-compile-variadic-numeric=20form)=0A+=20=20=20=20;;=20No=20args:=20=
warn=20and=20emit=20code=20that=20raises=20an=20error=20when=20executed.=0A=
+=20=20=20=20(byte-compile-normal-call=20form)))=0A=20=0A=20=0C=0A=20;;=20=
more=20complicated=20compiler=20macros=0A@@=20-3768,7=20+3774,7=20@@=20=
fset=0A=20(byte-defop-compiler=20indent-to)=0A=20(byte-defop-compiler=20=
insert)=0A=20(byte-defop-compiler-1=20function=20=
byte-compile-function-form)=0A-(byte-defop-compiler-1=20-=20=
byte-compile-minus)=0A+(byte-defop-compiler=20(-=20byte-diff)=20=
byte-compile-minus)=0A=20(byte-defop-compiler=20(/=20byte-quo)=20=
byte-compile-quo)=0A=20(byte-defop-compiler=20nconc)=0A=20=0A@@=20=
-3835,30=20+3841,17=20@@=20byte-compile-concat=0A=20=09=20=20=
((byte-compile-normal-call=20form)))))=0A=20=0A=20(defun=20=
byte-compile-minus=20(form)=0A-=20=20(let=20((len=20(length=20form)))=0A=
-=20=20=20=20(cond=0A-=20=20=20=20=20((=3D=201=20len)=20=
(byte-compile-constant=200))=0A-=20=20=20=20=20((=3D=202=20len)=0A-=20=20=
=20=20=20=20(byte-compile-form=20(cadr=20form))=0A-=20=20=20=20=20=20=
(byte-compile-out=20'byte-negate=200))=0A-=20=20=20=20=20((=3D=203=20=
len)=0A-=20=20=20=20=20=20(byte-compile-form=20(nth=201=20form))=0A-=20=20=
=20=20=20=20(byte-compile-form=20(nth=202=20form))=0A-=20=20=20=20=20=20=
(byte-compile-out=20'byte-diff=200))=0A-=20=20=20=20=20;;=20Don't=20use=20=
binary=20operations=20for=20>=202=20operands,=20as=20that=20may=0A-=20=20=
=20=20=20;;=20cause=20overflow/truncation=20in=20float=20operations.=0A-=20=
=20=20=20=20(t=20(byte-compile-normal-call=20form)))))=0A+=20=20(if=20=
(/=3D=20(length=20form)=202)=0A+=20=20=20=20=20=20=
(byte-compile-variadic-numeric=20form)=0A+=20=20=20=20(byte-compile-form=20=
(cadr=20form))=0A+=20=20=20=20(byte-compile-out=20'byte-negate=200)))=0A=20=
=0A=20(defun=20byte-compile-quo=20(form)=0A-=20=20(let=20((len=20(length=20=
form)))=0A-=20=20=20=20(cond=20((<=20len=202)=0A-=09=20=20=20=
(byte-compile-subr-wrong-args=20form=20"1=20or=20more"))=0A-=09=20=20((=3D=
=20len=203)=0A-=09=20=20=20(byte-compile-two-args=20form))=0A-=09=20=20=
(t=0A-=09=20=20=20;;=20Don't=20use=20binary=20operations=20for=20>=202=20=
operands,=20as=20that=0A-=09=20=20=20;;=20may=20cause=20=
overflow/truncation=20in=20float=20operations.=0A-=09=20=20=20=
(byte-compile-normal-call=20form)))))=0A+=20=20(if=20(=3D=20(length=20=
form)=203)=0A+=20=20=20=20=20=20(byte-compile-two-args=20form)=0A+=20=20=20=
=20;;=20N-ary=20`/'=20is=20not=20the=20left-reduction=20of=20binary=20=
`/'=20because=20if=20any=0A+=20=20=20=20;;=20argument=20is=20a=20float,=20=
then=20everything=20is=20done=20in=20floating-point.=0A+=20=20=20=20=
(byte-compile-normal-call=20form)))=0A=20=0A=20(defun=20=
byte-compile-nconc=20(form)=0A=20=20=20(let=20((len=20(length=20form)))=0A=
--=20=0A2.21.1=20(Apple=20Git-122.3)=0A=0A=

--Apple-Mail=_ED3C32FC-7395-4167-8EF0-53313C747201--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#42597; Package emacs. Full text available.

Message received at 42597 <at> debbugs.gnu.org:


Received: (at 42597) by debbugs.gnu.org; 29 Jul 2020 18:32:59 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jul 29 14:32:59 2020
Received: from localhost ([127.0.0.1]:33711 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1k0qsm-00047N-8Z
	for submit <at> debbugs.gnu.org; Wed, 29 Jul 2020 14:32:59 -0400
Received: from mx.sdf.org ([205.166.94.24]:62272)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <akrl@HIDDEN>) id 1k0qsh-00047C-PX
 for 42597 <at> debbugs.gnu.org; Wed, 29 Jul 2020 14:32:51 -0400
Received: from mab (ma.sdf.org [205.166.94.33])
 by mx.sdf.org (8.15.2/8.14.5) with ESMTP id 06TIWjnx021190;
 Wed, 29 Jul 2020 18:32:45 GMT
From: Andrea Corallo <akrl@HIDDEN>
To: Alan Mackenzie <acm@HIDDEN>
Subject: Re: bug#42597: 27.1; (+ -0.0) returns +0.0 when compiled (fwd)
References: <1A998EAD-92A5-42FD-B382-33C0FE2A7D20@HIDDEN>
 <ff6ceb4e-27a0-9339-34ab-1a6ad40352c@HIDDEN>
Date: Wed, 29 Jul 2020 18:32:45 +0000
In-Reply-To: <ff6ceb4e-27a0-9339-34ab-1a6ad40352c@HIDDEN> (Alan Mackenzie's
 message of "Wed, 29 Jul 2020 15:41:27 +0200 (CEST)")
Message-ID: <xjfwo2mcgtu.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 42597
Cc: 42597 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Alan Mackenzie <acm@HIDDEN> writes:

> Hello, Mattias.
>
> In article <mailman.247.1596026464.2739.bug-gnu-emacs@HIDDEN> you wrote:
>> Unary +, *, min and max, all of which should be identity for numbers,
>> convert -0.0 to +0.0 when byte-compiled:
>
> They convert what?
>
>> (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!
>
> This is an example of what happens when ignorant people rule the roost.
> -0.0 and +0.0 are identically the same thing.  It should not take a
> degree in mathematics (which I have) to realise this.  When you put
> mathematical nonsense into <whatever thing is producing -0.0> you cannot
> help but get nonsense back out.
>
> 0.0 does not need two different names.  It can do nothing but produce
> confusion, what has clearly happened here at whatever level.
>
> So my suggestion D. would be: Eliminate "-0.0" from Emacs Lisp.  If this
> is not possible for whatever reason, then E. Do nothing.

For completeness I'd like to link what is prescribed on that for CL:

<http://clhs.lisp.se/Body/f_eq_sle.htm>

"
Notes:

=3D differs from eql in that (=3D 0.0 -0.0) is always true, because =3D
compares the mathematical values of its operands, whereas eql compares
the representational values, so to speak.
"

  Andrea

--=20
akrl@HIDDEN




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#42597; Package emacs. Full text available.

Message received at 42597 <at> debbugs.gnu.org:


Received: (at 42597) by debbugs.gnu.org; 29 Jul 2020 13:41:37 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jul 29 09:41:37 2020
Received: from localhost ([127.0.0.1]:60392 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1k0mKu-0000oO-WE
	for submit <at> debbugs.gnu.org; Wed, 29 Jul 2020 09:41:37 -0400
Received: from colin.muc.de ([193.149.48.1]:51775 helo=mail.muc.de)
 by debbugs.gnu.org with smtp (Exim 4.84_2)
 (envelope-from <acm@HIDDEN>) id 1k0mKr-0000o4-SA
 for 42597 <at> debbugs.gnu.org; Wed, 29 Jul 2020 09:41:35 -0400
Received: (qmail 24915 invoked by uid 3782); 29 Jul 2020 13:41:27 -0000
Date: Wed, 29 Jul 2020 15:41:27 +0200 (CEST)
From: Alan Mackenzie <acm@HIDDEN>
To: 42597 <at> debbugs.gnu.org
Subject: Re: bug#42597: 27.1; (+ -0.0) returns +0.0 when compiled (fwd)
Message-ID: <ff6ceb4e-27a0-9339-34ab-1a6ad40352c@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="351380202-517121245-1596030087=:82184"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 42597
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

--351380202-517121245-1596030087=:82184
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: QUOTED-PRINTABLE


Hello, Mattias.

In article <mailman.247.1596026464.2739.bug-gnu-emacs@HIDDEN> you wrote:
> Unary +, *, min and max, all of which should be identity for numbers,
> convert -0.0 to +0.0 when byte-compiled:

They convert what?

> (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!

This is an example of what happens when ignorant people rule the roost.
-0.0 and +0.0 are identically the same thing.  It should not take a
degree in mathematics (which I have) to realise this.  When you put
mathematical nonsense into <whatever thing is producing -0.0> you cannot
help but get nonsense back out.

0.0 does not need two different names.  It can do nothing but produce
confusion, what has clearly happened here at whatever level.

So my suggestion D. would be: Eliminate "-0.0" from Emacs Lisp.  If this
is not possible for whatever reason, then E. Do nothing.

--=20
Alan Mackenzie (Nuremberg, Germany).

--351380202-517121245-1596030087=:82184--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#42597; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 29 Jul 2020 12:40:28 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jul 29 08:40:28 2020
Received: from localhost ([127.0.0.1]:60306 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1k0lNk-0007mc-57
	for submit <at> debbugs.gnu.org; Wed, 29 Jul 2020 08:40:28 -0400
Received: from lists.gnu.org ([209.51.188.17]:36422)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mattiase@HIDDEN>) id 1k0lNi-0007mV-Uh
 for submit <at> debbugs.gnu.org; Wed, 29 Jul 2020 08:40:27 -0400
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 <mattiase@HIDDEN>) id 1k0lNi-00010l-HW
 for bug-gnu-emacs@HIDDEN; Wed, 29 Jul 2020 08:40:26 -0400
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 <mattiase@HIDDEN>) id 1k0lNg-0002jc-AK
 for bug-gnu-emacs@HIDDEN; Wed, 29 Jul 2020 08:40:26 -0400
X-Authenticated-User: mattiase@HIDDEN
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@HIDDEN
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 <bug-gnu-emacs@HIDDEN>; Wed, 29 Jul 2020 12:07:34 +0000
From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= <mattiase@HIDDEN>
Content-Type: text/plain;
	charset=utf-8
Content-Transfer-Encoding: quoted-printable
Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.15\))
Subject: 27.1; (+ -0.0) returns +0.0 when compiled
Message-Id: <1A998EAD-92A5-42FD-B382-33C0FE2A7D20@HIDDEN>
Date: Wed, 29 Jul 2020 14:07:32 +0200
To: bug-gnu-emacs@HIDDEN
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-Rules: 
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@HIDDEN;
 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-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

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!





Acknowledgement sent to Mattias Engdegård <mattiase@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#42597; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Fri, 7 Aug 2020 09:00:01 UTC

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