From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Andrea Corallo Newsgroups: gmane.emacs.bugs Subject: bug#62537: Error compiling emacs master with native compilation activated Date: Fri, 31 Mar 2023 10:26:20 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34223"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: 62537@debbugs.gnu.org, Pedro Andres Aranda Gutierrez 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 Fri Mar 31 12:27:17 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 1piByW-0008gg-Qw for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 31 Mar 2023 12:27:16 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1piByK-0003t9-TF; Fri, 31 Mar 2023 06:27:05 -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 1piByH-0003s3-VX for bug-gnu-emacs@gnu.org; Fri, 31 Mar 2023 06:27:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1piByH-0000eI-Nx for bug-gnu-emacs@gnu.org; Fri, 31 Mar 2023 06:27:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1piByH-0001VC-Kc for bug-gnu-emacs@gnu.org; Fri, 31 Mar 2023 06:27:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Andrea Corallo Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 31 Mar 2023 10:27:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62537 X-GNU-PR-Package: emacs Original-Received: via spool by 62537-submit@debbugs.gnu.org id=B62537.16802583965730 (code B ref 62537); Fri, 31 Mar 2023 10:27:01 +0000 Original-Received: (at 62537) by debbugs.gnu.org; 31 Mar 2023 10:26:36 +0000 Original-Received: from localhost ([127.0.0.1]:60435 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1piBxs-0001UL-3y for submit@debbugs.gnu.org; Fri, 31 Mar 2023 06:26:36 -0400 Original-Received: from mx.sdf.org ([205.166.94.24]:53182) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1piBxq-0001UD-Ts for 62537@debbugs.gnu.org; Fri, 31 Mar 2023 06:26:35 -0400 Original-Received: from ma.sdf.org (ma.sdf.org [205.166.94.33]) by mx.sdf.org (8.16.1/8.14.5) with ESMTPS id 32VAQKWZ013115 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits) verified NO); Fri, 31 Mar 2023 10:26:21 GMT In-Reply-To: (Andrea Corallo's message of "Thu, 30 Mar 2023 13:35:27 +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:258987 Archived-At: Andrea Corallo writes: > Mattias Engdeg=C3=A5rd writes: > >> 30 mars 2023 kl. 11.28 skrev Andrea Corallo : >> >>> bisecting this should be due to: >>> " >>> 52b67740d10df8ca539fdc2c7d50283997683141 >> >>> Generalise a LAP optimisation rule >> >> That change should be entirely safe. Perhaps it just somehow triggers an= unexpected path in nativecomp? > > That's entirely possible :) > > Will look at and report. > > Andrea I haven't had time to complete the investigation/fix but as data point... This is the most reduced reproducer I could produce: ;;; -*- lexical-binding: t; -*- (defun test () (when (let ((val (foo))) (cond ((eq val 'x) t) ((eq val 'y) 'y))) (foo)) t) This is the old LAP: (byte-constant foo . 0) (byte-call . 0) (byte-dup) (byte-constant #s(hash-table size 2 test eq rehash-size 1.5 rehash-threshol= d 0.8125 purecopy t data (x 8 y 12)) . 1) (byte-switch) (byte-goto TAG 16 . 1) (TAG 8 . 1) (byte-constant t . 2) (byte-goto TAG 17 . 2) (TAG 12 . 1) (byte-constant t . 2) (byte-goto TAG 17 . 2) (TAG 16 . 1) (byte-constant nil . 3) (TAG 17 . 2) (byte-stack-set . 1) (byte-goto-if-nil TAG 25 . 0) (byte-constant foo . 0) (byte-call . 0) (byte-discard) (TAG 25 . 0) (byte-constant t . 2) (byte-return . 0) This is the new one: (byte-constant foo . 0) (byte-call . 0) (byte-dup) (byte-constant #s(hash-table size 2 test eq rehash-size 1.5 rehash-threshol= d 0.8125 purecopy t data (x 9 y 9)) . 1) (byte-switch) (byte-discard) (byte-goto TAG 13 . 0) (TAG 9 . 1) (byte-discard) (byte-constant foo . 0) (byte-call . 0) (byte-discard) (TAG 13 . 0) (byte-constant t . 2) (byte-return . 0) At a very quick look I don't see anything wrong with it so as anticipated most lickly is just a bug in the native compiler limplify pass. Best Regards Andrea