From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Floating-point constant folding in Emacs byte compiler Date: Mon, 26 Mar 2018 18:13:22 +0300 Message-ID: <83h8p2g99p.fsf@gnu.org> References: <2ce39e5c-cd1b-65d6-b125-719caad67932@cs.ucla.edu> <83vadmgfbz.fsf@gnu.org> <87d0zr2n1u.fsf@gmail.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1522078554 14450 195.159.176.226 (26 Mar 2018 15:35:54 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 26 Mar 2018 15:35:54 +0000 (UTC) Cc: emacs-devel@gnu.org To: Robert Pluim Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Mar 26 17:35:50 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f0UA1-0003cU-9i for ged-emacs-devel@m.gmane.org; Mon, 26 Mar 2018 17:35:49 +0200 Original-Received: from localhost ([::1]:57422 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f0UC4-0004Uw-Ni for ged-emacs-devel@m.gmane.org; Mon, 26 Mar 2018 11:37:56 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56289) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f0ToC-00007G-8v for emacs-devel@gnu.org; Mon, 26 Mar 2018 11:13:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f0To9-00052S-5J for emacs-devel@gnu.org; Mon, 26 Mar 2018 11:13:16 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:45551) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f0To9-00052J-0f; Mon, 26 Mar 2018 11:13:13 -0400 Original-Received: from [176.228.60.248] (port=2872 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1f0To8-0000uh-D7; Mon, 26 Mar 2018 11:13:12 -0400 In-reply-to: <87d0zr2n1u.fsf@gmail.com> (message from Robert Pluim on Mon, 26 Mar 2018 11:39:25 +0200) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:224036 Archived-At: > X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_05,FREEMAIL_FROM, > T_DKIM_INVALID autolearn=disabled version=3.3.2 > From: Robert Pluim > Cc: Pip Cet , eggert@cs.ucla.edu, emacs-devel@gnu.org > Gmane-Reply-To-List: yes > Date: Mon, 26 Mar 2018 11:39:25 +0200 > > >> I imagine that on a 32-bit version of emacs, (byte-compile (lambda (x) > >> (* #x10000 #x10000))) similarly produces a constant-zero function, > > > > The result depends on whether Emacs was build --with-wide-int. If it > > was, the result is #[(x) "\300\207" [4294967296] 1], if it wasn't, I > > get #[(x) "\300\207" [0] 1]. > > Hmm, would it be worthwhile to have Emacs signal overflow in such a > situation (perhaps controlled by a configuration variable) so we could > fix such issues? In which of these two cases do you see overflow? I also don't think I understand the utility of signaling an overflow error from the byte compiler that happened because it did constant folding. What else except bug reports could this yield?