From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Robert Pluim Newsgroups: gmane.emacs.devel Subject: Re: Floating-point constant folding in Emacs byte compiler Date: Mon, 26 Mar 2018 17:57:01 +0200 Message-ID: <87370m3k4y.fsf@gmail.com> References: <2ce39e5c-cd1b-65d6-b125-719caad67932@cs.ucla.edu> <83vadmgfbz.fsf@gnu.org> <87d0zr2n1u.fsf@gmail.com> <83h8p2g99p.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1522079718 31627 195.159.176.226 (26 Mar 2018 15:55:18 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 26 Mar 2018 15:55:18 +0000 (UTC) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Mar 26 17:55:14 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 1f0USo-00086D-58 for ged-emacs-devel@m.gmane.org; Mon, 26 Mar 2018 17:55:14 +0200 Original-Received: from localhost ([::1]:57565 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f0UUp-0005mb-Ld for ged-emacs-devel@m.gmane.org; Mon, 26 Mar 2018 11:57:19 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42709) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f0UUe-0005l9-7C for emacs-devel@gnu.org; Mon, 26 Mar 2018 11:57:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f0UUb-0006WK-2y for emacs-devel@gnu.org; Mon, 26 Mar 2018 11:57:08 -0400 Original-Received: from mail-wm0-x234.google.com ([2a00:1450:400c:c09::234]:40701) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f0UUa-0006Vp-Sp; Mon, 26 Mar 2018 11:57:05 -0400 Original-Received: by mail-wm0-x234.google.com with SMTP id x4so4100252wmh.5; Mon, 26 Mar 2018 08:57:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:mail-followup-to:mail-copies-to :gmane-reply-to-list:date:in-reply-to:message-id:mime-version; bh=y64VC44Eq1dvN/d0S5BU2fHxl/sWwtM1e0DbRN8TCco=; b=eX2F4/TclNYnrMcHJwRqJ2LKqjA9Od9eCQ81Emn271zZDsngL705IsjeojkWQpj0lA UM2u8Nj7jIqP/Lqr5vy7wgRF8kX7+QDjLEiS7ezF3k236T9ijzBt97E1VAHqsPjKXJvy ZgYGPNG7frBA1UQX3SZPhTFtOKnhiNePjAZ3rN+vo3bqgA2MErzn4ar1Gg71juk+f7r8 +j1AQooD9uymMpgUewg6Xu7y9eLd6wWJwhGyHrb+MjjYdxq0SfgoCAES1iXoi/Yr7vDF g2QK4Mr14OneSnMH4G0azzwceJnVn1ppLtqt19vSs2A4Dc4jzkpNfWQhy0ozyjZEzQBO BKWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:mail-followup-to :mail-copies-to:gmane-reply-to-list:date:in-reply-to:message-id :mime-version; bh=y64VC44Eq1dvN/d0S5BU2fHxl/sWwtM1e0DbRN8TCco=; b=Epp5zjVCYf5qKAG7W7bipdrqR655QK1htEbAjFh4ORrEhZUhai/uA4DNvVnA+HRvaq RgdX/lTTUNJmlr952UwGeZEc/L0tfQhhnxmtnjKY3B1SeN0gnG6fFIh8JWAmueplmlRG q8EKs1+GHpxkmpoZ7zebNhJDonbPRN3WZJVFH+1rbUjxKXq8zy1JuTMoyG+j+nr9/WoF ZbeC/WUq1cR17qOJCmfZ9NVjps5Z4+zcFUR51dgDAASobhbs4xJcbhKJCkx9ZO7/yo3T 8rBVosd34/oZYX1IFfnmN1bwgZ/3eApR92B2wKCoi6pEzHMwrPQeLwvOQWcpDHoJKzRF TFxg== X-Gm-Message-State: AElRT7HBCLl5Uyld2TI27d9LrLP1L/BuOdRnz8d5julOs765bQqsCJBa 8c4yXnVpzeqG8zE4kNUov3XN7VSF X-Google-Smtp-Source: AG47ELsLiwHjA4nizlTnv6BjupVW0cFdyR+r4VQjih7mpWdKe/gX2G5nhgvfxoMvd2GKB0f0dZ4/7w== X-Received: by 10.28.159.68 with SMTP id i65mr16863555wme.27.1522079823181; Mon, 26 Mar 2018 08:57:03 -0700 (PDT) Original-Received: from rpluim ([149.5.228.1]) by smtp.gmail.com with ESMTPSA id y6sm16844177wmy.16.2018.03.26.08.57.02 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 26 Mar 2018 08:57:02 -0700 (PDT) Mail-Followup-To: emacs-devel@gnu.org Mail-Copies-To: never Gmane-Reply-To-List: yes In-Reply-To: <83h8p2g99p.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 26 Mar 2018 18:13:22 +0300") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::234 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:224042 Archived-At: Eli Zaretskii writes: >> 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? > Does (* #x10000 #x10000) not overflow on 32-bit? Or have I missed a bit somewhere? > 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? I was proposing it as a debug option, not a generally enabled one. Of course if there's no overflow, it would be kind of useless :-) Robert