From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#74771: Native compilation bug with struct predicates when lexical binding enabled (HEAD) Date: Sat, 28 Dec 2024 12:58:22 +0200 Message-ID: <865xn4ul9t.fsf@gnu.org> References: <0446a656-1fa2-4160-a8ba-69c060a52589@risk-engineering.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9917"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 74771@debbugs.gnu.org, eric.marsden@risk-engineering.org To: Andrea Corallo Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Dec 28 11:59:17 2024 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 1tRUXM-0002R1-R8 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 28 Dec 2024 11:59:17 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tRUXD-0003Og-L4; Sat, 28 Dec 2024 05:59:07 -0500 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 1tRUX9-0003O3-Bz for bug-gnu-emacs@gnu.org; Sat, 28 Dec 2024 05:59:03 -0500 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 1tRUX8-0003Oi-GH for bug-gnu-emacs@gnu.org; Sat, 28 Dec 2024 05:59:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-version:References:In-Reply-To:From:Date:To:Subject; bh=UqS6CdiQulxSny/S0dwfpCaehgy40IPpALMSWunZ5AI=; b=AiJIu2BmSPbKCoBbLYg6ioMGBdXgzfBalY6GrM7ZWQ7/EfjIzCklFNaACLShjclL1En8dFEvyBAgOTdojjUaU1E+jveAA7WGFFrR6jFRW9QlWCD0z/F3kjOftXiMRPJShrV+AVGf96/3Ncf4ZwAgi1v6WZN4GgFpEc/jEsM1sxdznO0sJa9s6Q0dZUUjvR40HezCFSBW4S2UAJnhk7aKDbdxl6j27S/DiPYb7ltq68shCMCG7gRNYeKh7hvF80xDw+G3irKPtLaEDiX/VVXsXkfmQ8ckd6KDbcb9ORwCZnJTTVQ6CLUZHunr7EDGiwqcp4qMRUsWjvbPkLfvnTqRrQ==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tRUX8-0005uu-AJ for bug-gnu-emacs@gnu.org; Sat, 28 Dec 2024 05:59:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 28 Dec 2024 10:59:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74771 X-GNU-PR-Package: emacs Original-Received: via spool by 74771-submit@debbugs.gnu.org id=B74771.173538351622702 (code B ref 74771); Sat, 28 Dec 2024 10:59:02 +0000 Original-Received: (at 74771) by debbugs.gnu.org; 28 Dec 2024 10:58:36 +0000 Original-Received: from localhost ([127.0.0.1]:48904 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tRUWh-0005u5-Rx for submit@debbugs.gnu.org; Sat, 28 Dec 2024 05:58:36 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:35224) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tRUWf-0005ts-Hn for 74771@debbugs.gnu.org; Sat, 28 Dec 2024 05:58:33 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tRUWZ-0003MR-TW; Sat, 28 Dec 2024 05:58:27 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=UqS6CdiQulxSny/S0dwfpCaehgy40IPpALMSWunZ5AI=; b=frJnoEkrEb0Scw0+AmAv BEzxWsXNtQeDC1tcp1K8RS004DCuMhe3Q1rQYod8V4OUnstvJfA2s1FIVM/nXF/mJaLo8t7Wuee4W FXd8f6K3bAz7/58QF6dfD/F+ubvjyyg2T5AGtK6xW1oBuPrAOU/n/4FwpHvSU85s0B0jaIoiA/X6W jkDU3k7JitBkHjdQqkBLHYrATYmm7bh2QxekdmyJsE4LyapahTC9Eb897RyAB3OztEht62HR0LDDX v+pG5bCqtqvZw1EetjGgYVGBuqirDr1VYQFhCxwm5i6dhEmJhGs5cGPTM38wvqGKJAt0CtqgVJgeQ U/kZaMenKFk7Nw==; In-Reply-To: (message from Andrea Corallo on Wed, 11 Dec 2024 17:29:34 -0500) 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:297866 Archived-At: > Cc: 74771@debbugs.gnu.org > From: Andrea Corallo > Date: Wed, 11 Dec 2024 17:29:34 -0500 > > Eric Marsden writes: > > > Hi, > > > > With the attached source file, Emacs miscompiles the struct predicate such > > that a repeated call to the predicate on a non-struct object returns t. > > This occurs with current HEAD on Linux/AMD64, but not on the Emacs 30.0.92 > > pretest. It does not occur when the lexical binding cookie is not present. > > > > % /opt/emacs/bin/emacs -Q --batch --eval "(load (native-compile \"/tmp/bug.el\"))" -f run > > Loading /home/emarsden/.emacs.d/eln-cache/31.0.50-c021c983/bug-59c4b27c-c70072f9.eln (native compiled elisp)... > > Running in GNU Emacs 31.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.43, cairo version 1.18.2) > >  of 2024-12-09 > > is? nil > > is? t   ;; expecting nil > > bar: 111 > > > > ;;; -*- lexical-binding: t -*- > > ;; > > ;; /opt/emacs/bin/emacs -Q --batch -L . --eval "(load (native-compile \"/tmp/bug.el\"))" -f run > > > > (require 'cl-lib) > > > > (cl-defstruct foobles bar baz) > > > > (defun bug (foo) > > (message "is? %s" (foobles-p foo)) > > (message "is? %s" (foobles-p foo)) > > (message "bar: %s" (foobles-bar foo))) > > > > (defun run () > > (message "Running in %s" (version)) > > (let ((foo "foo")) > > (bug foo))) > > Hi Eric, > > thanks for the report, I'll look at this in the coming days. Any progress here?