From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#46502: 28.0.50; [feature/native-comp] (d3a399dd) native-comp bootstrap failure Date: Sat, 20 Feb 2021 10:42:34 -0500 Message-ID: References: <87o8gn8ciy.fsf@md5i.com> <83h7m95tt2.fsf@gnu.org> <83ft1s2mp1.fsf@gnu.org> <83a6rz15jm.fsf@gnu.org> <831rdb0yt9.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7005"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: mwd@md5i.com, 46502@debbugs.gnu.org, akrl@sdf.org To: Pip Cet Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Feb 20 16:43:18 2021 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 1lDUPd-0001i4-Op for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 20 Feb 2021 16:43:17 +0100 Original-Received: from localhost ([::1]:44830 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lDUPc-000779-Hu for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 20 Feb 2021 10:43:16 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40162) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lDUPO-000771-Ae for bug-gnu-emacs@gnu.org; Sat, 20 Feb 2021 10:43:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:41124) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lDUPN-0003JA-Vg for bug-gnu-emacs@gnu.org; Sat, 20 Feb 2021 10:43:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lDUPN-0004fo-Sc for bug-gnu-emacs@gnu.org; Sat, 20 Feb 2021 10:43:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 20 Feb 2021 15:43:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46502 X-GNU-PR-Package: emacs Original-Received: via spool by 46502-submit@debbugs.gnu.org id=B46502.161383577117948 (code B ref 46502); Sat, 20 Feb 2021 15:43:01 +0000 Original-Received: (at 46502) by debbugs.gnu.org; 20 Feb 2021 15:42:51 +0000 Original-Received: from localhost ([127.0.0.1]:52670 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lDUPC-0004fQ-SN for submit@debbugs.gnu.org; Sat, 20 Feb 2021 10:42:51 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:23372) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lDUP8-0004fB-KQ for 46502@debbugs.gnu.org; Sat, 20 Feb 2021 10:42:50 -0500 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 2109480229; Sat, 20 Feb 2021 10:42:41 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 77130801F3; Sat, 20 Feb 2021 10:42:35 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1613835755; bh=d57c/oi5OpVlM0RMg5Hg7duh1P0n8LZfaN4XyNLC6VE=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=TxDencjLDLwlZ75y2H8cDx6rMGTnJnUVX6K7HaOu+rTAYJssygn7IZz3I34QN+qKC FMJej+kTDj56RIhhG5LgVNaU+gfUgpM+LTDVWVfe6J0QArVn0XDH+/di/fIm5AjKhr 2Ib9eSmMhTAGIC4iJ8f0RqVis1/5CRCBluUjy8fKh34plSoqVZ8YZwd0f6n3+jomXo QpemvlVvQHCufIKPjHwR0HeobRsIHc3c7VllyLTpOcA46OsMFqCwEBbPU3U5/Nw9rI AU4cbXvJfEhCswP+24amyPEzi+8gnNxeCZndEb6/+k0UX1rn2GmmPA4d/76XHIz2xX J6UR2BNTxeSnQ== Original-Received: from alfajor (unknown [216.154.41.47]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 387A8120334; Sat, 20 Feb 2021 10:42:35 -0500 (EST) In-Reply-To: <831rdb0yt9.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 20 Feb 2021 13:21:38 +0200") 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:200438 Archived-At: >> > Can you send the diffs as an attachment? >> >> I'm sending the complete diff, even though it's a bit large... The >> path differences are obviously okay, and I'm not going to complain >> about differences in gensym numbering, but byte-optimize-lapcode, to >> pick an example at random, differs in the bytecode. > > Thanks. Stefan, any idea why we see differences here? One of the possibility is always the inlining (where we either inline the source code or the bytecode depending on whether the function to be inlined has already been byte-compiled). Can you try the patch below to see if it makes a difference? Stefan diff --git a/lisp/emacs-lisp/byte-opt.el b/lisp/emacs-lisp/byte-opt.el index e0feb95a46..06c925b7bf 100644 --- a/lisp/emacs-lisp/byte-opt.el +++ b/lisp/emacs-lisp/byte-opt.el @@ -268,32 +269,16 @@ byte-compile-inline-expand ;; The byte-code will be really inlined in byte-compile-unfold-bcf. `(,fn ,@(cdr form))) ((or `(lambda . ,_) `(closure . ,_)) - (if (not (or (eq fn localfn) ;From the same file => same mode. - (eq (car fn) ;Same mode. - (if lexical-binding 'closure 'lambda)))) - ;; While byte-compile-unfold-bcf can inline dynbind byte-code into - ;; letbind byte-code (or any other combination for that matter), we - ;; can only inline dynbind source into dynbind source or letbind - ;; source into letbind source. - (progn - ;; We can of course byte-compile the inlined function - ;; first, and then inline its byte-code. - (byte-compile name) - `(,(symbol-function name) ,@(cdr form))) - (let ((newfn (if (eq fn localfn) - ;; If `fn' is from the same file, it has already - ;; been preprocessed! - `(function ,fn) - ;; Try and process it "in its original environment". - (let ((byte-compile-bound-variables nil)) - (byte-compile-preprocess - (byte-compile--reify-function fn)))))) - (if (eq (car-safe newfn) 'function) - (macroexp--unfold-lambda `(,(cadr newfn) ,@(cdr form))) - ;; This can happen because of macroexp-warn-and-return &co. - (byte-compile-warn - "Inlining closure %S failed" name) - form)))) + (if (eq fn localfn) ;From the same file => same mode. + (macroexp--unfold-lambda `(,fn ,@(cdr form))) + ;; While byte-compile-unfold-bcf can inline dynbind byte-code into + ;; letbind byte-code (or any other combination for that matter), we + ;; can only inline dynbind source into dynbind source or letbind + ;; source into letbind source. + ;; We can of course byte-compile the inlined function + ;; first, and then inline its byte-code. + (byte-compile name) + `(,(symbol-function name) ,@(cdr form)))) (_ ;; Give up on inlining. form))))