From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#54990: Byte compiler bug Date: Mon, 18 Apr 2022 10:48:43 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4658"; mail-complaints-to="usenet@ciao.gmane.io" Cc: acm@muc.de, Lars Ingebrigtsen , 54990-done@debbugs.gnu.org To: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Apr 18 12:49:13 2022 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 1ngOwS-00012p-3B for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 18 Apr 2022 12:49:12 +0200 Original-Received: from localhost ([::1]:40666 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ngOwQ-0000M9-Rq for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 18 Apr 2022 06:49:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60432) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ngOwI-0000JZ-Uj for bug-gnu-emacs@gnu.org; Mon, 18 Apr 2022 06:49:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:44268) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ngOwI-0002WH-IY for bug-gnu-emacs@gnu.org; Mon, 18 Apr 2022 06:49:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ngOwI-0002Fs-Fo for bug-gnu-emacs@gnu.org; Mon, 18 Apr 2022 06:49:02 -0400 Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Mon, 18 Apr 2022 10:49:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 54990 X-GNU-PR-Package: emacs Mail-Followup-To: 54990@debbugs.gnu.org, acm@muc.de, acm@muc.de Original-Received: via spool by 54990-done@debbugs.gnu.org id=D54990.16502789328644 (code D ref 54990); Mon, 18 Apr 2022 10:49:02 +0000 Original-Received: (at 54990-done) by debbugs.gnu.org; 18 Apr 2022 10:48:52 +0000 Original-Received: from localhost ([127.0.0.1]:38165 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ngOw8-0002FL-LQ for submit@debbugs.gnu.org; Mon, 18 Apr 2022 06:48:52 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:51659 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1ngOw7-0002F7-63 for 54990-done@debbugs.gnu.org; Mon, 18 Apr 2022 06:48:51 -0400 Original-Received: (qmail 8221 invoked by uid 3782); 18 Apr 2022 10:48:44 -0000 Original-Received: from acm.muc.de (p4fe15b93.dip0.t-ipconnect.de [79.225.91.147]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Mon, 18 Apr 2022 12:48:43 +0200 Original-Received: (qmail 6989 invoked by uid 1000); 18 Apr 2022 10:48:43 -0000 Content-Disposition: inline In-Reply-To: X-Submission-Agent: TMDA/1.3.x (Ph3nix) X-Primary-Address: acm@muc.de 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:230164 Archived-At: Hello, Mattias. On Sun, Apr 17, 2022 at 16:32:53 +0200, Mattias Engdegård wrote: > This is related to symbol positioning so Alan should be well-placed to > debug it. (The symbol names are irrelevant.) I'd got just as far as identifying the merge of scratch/correct-warning-pos as the first version containing the bug. > It's `compile-defun` that is broken; the constant vector of the > resulting bytecode contains symbols with position as hash table keys > for a switch operation. Compare the bytecode object with that from > `byte-compile` which works correctly: Thank you for this observation. It was _exceptionally_ helpful. > (defun tata (x) > (cond > ((eq x 'a) 'toto) > ((eq x 'b) 'titi))) > (byte-compile 'tata) > => > #[257 "..." [#s(hash-table size 2 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (a 6 b 8)) toto titi nil] 3 "..."] > ;; if using `compile-defun` on `tata`: > (symbol-function 'tata) > #[257 "..." [#s(hash-table size 2 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (# 6 # 8)) toto titi nil] 3 "..."] I've committed a fix, which I'm pretty sure works, so I'm closing the bug with this post. Thanks again for the help! -- Alan Mackenzie (Nuremberg, Germany).