From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#65017: 29.1; Byte compiler interaction with cl-lib function objects, removes symbol-function Date: Wed, 09 Aug 2023 23:41:56 -0400 Message-ID: References: <8B08E514-B2D5-48F5-BA90-4F5A9492F8F9@gmail.com> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40547"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= , 65017@debbugs.gnu.org, Eric Marsden To: Alan Mackenzie Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Aug 10 05:43:20 2023 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 1qTwa0-000AQJ-IM for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 10 Aug 2023 05:43:20 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qTwZk-0000Ah-Mf; Wed, 09 Aug 2023 23:43:04 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qTwZj-0000AZ-Up for bug-gnu-emacs@gnu.org; Wed, 09 Aug 2023 23:43:03 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qTwZj-0001LW-N2 for bug-gnu-emacs@gnu.org; Wed, 09 Aug 2023 23:43:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qTwZi-0005Av-Pv for bug-gnu-emacs@gnu.org; Wed, 09 Aug 2023 23:43:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 10 Aug 2023 03:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65017 X-GNU-PR-Package: emacs Original-Received: via spool by 65017-submit@debbugs.gnu.org id=B65017.169163893219831 (code B ref 65017); Thu, 10 Aug 2023 03:43:02 +0000 Original-Received: (at 65017) by debbugs.gnu.org; 10 Aug 2023 03:42:12 +0000 Original-Received: from localhost ([127.0.0.1]:40932 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qTwYt-00059m-LB for submit@debbugs.gnu.org; Wed, 09 Aug 2023 23:42:12 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:53325) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qTwYq-00059N-EC for 65017@debbugs.gnu.org; Wed, 09 Aug 2023 23:42:09 -0400 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 7C54E1000DB; Wed, 9 Aug 2023 23:42:02 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1691638921; bh=yUY7whvsZTT2fh5Af8910LJB8RKzEySI8fnRTt0BkXs=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=EtPNojFSM7BfhssccKZ6WIgQVCxB509lLMlLZbDu0xpYSpMHZiH5e2P6sRshztJDW K8e+pgx4Ukzat4v9habDuGkzQkmuT9g0G9ih/M/HInaP5kMWnCzMiB58bH22+/oJ6P VzT69FTxh98uIxEJjXVLuqm2QalT9IKlI86X9LTNYXWTxTF2OBPoKCzn/8GOy/EwjU qfGchNN8lIw92ndCUFeoXRsVpARqwwxkdgtvYBxEmukrhazwifThN4CfZ48Ubr6COg 5fZkMgY20Rdk1cRlQaoJdyP1xn5cbw83GmmDLjcn8A8WcEVGL1w4ugjMaW5mf3+lTS 3mzd1IR5HffLQ== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 5D5C8100068; Wed, 9 Aug 2023 23:42:01 -0400 (EDT) Original-Received: from alfajor (unknown [190.190.107.145]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 274BD1202DD; Wed, 9 Aug 2023 23:41:59 -0400 (EDT) In-Reply-To: (Alan Mackenzie's message of "Tue, 8 Aug 2023 16:56:03 +0000") 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:267078 Archived-At: >> > Are you sure? >> Yes. > What about two SWPs with the same symbol but different positions? If > they aren't considered EQ here, there will never be a match for the > first arm of the cond form in cl--labels-convert; then > cl--labels-convert-cache will get written, but never used. Nope: when it gets written, the `function` macro returns: (function ) so the macro is immediately called again with the *exact* same , so the second time the `function` macro is called, the cache does hit (and it's the only case where it should hit), making the second call to the macro return the *exact* `eq`-same (function ) list which is the trick that stops the infinite macroexpansion loop. Next time the `function` macro is invoked with a "similar" sympos the cache should *not* match because we don't want to accidentally replace (function ) with (function ) > And if, somehow, it does get used (the current code, I think), then (as > you write below) the argument F will get replaced by an F with the wrong > position. Am I right, here? That's right. > Why must the F get replaced by a different F? There must surely be a > way, a simpler way than the current cl--labels-convert, to retain the > current F (hence, not corrupting its position)? There might. The current hack is the best I could come up with. >> > If cl--labels-convert-cache is being used >> > inside the byte compiler, it surely needs to consider #> > 42> and # as eq? >> No, it should not treat them equal (when it does, it introduces an >> incorrect sympos and can thus lead to error messages pointing at the >> wrong place). > Then isn't what is wrong here the introduction of the incorrect SWP > rather than treating the two SWPs as EQ? I can't see how to separate one from the other here: the introduction of the incorrect SWP is due to treating the two SWP as `eq`. > This is obscure, difficult code. :-( Agreed. > We should think about committing a fix to the original bug, > sometime, too. I'm not completely sure we agree yet on what is "the original bug", but obviously I agree with your sentence :-) Stefan