unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Pip Cet <pipcet@gmail.com>
Cc: mwd@md5i.com, 46502@debbugs.gnu.org, akrl@sdf.org
Subject: bug#46502: 28.0.50; [feature/native-comp] (d3a399dd) native-comp bootstrap failure
Date: Sat, 20 Feb 2021 10:42:34 -0500	[thread overview]
Message-ID: <jwv5z2mzr24.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <831rdb0yt9.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 20 Feb 2021 13:21:38 +0200")

>> > 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))))






  parent reply	other threads:[~2021-02-20 15:42 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-14  5:05 bug#46502: 28.0.50; [feature/native-comp] (d3a399dd) native-comp bootstrap failure Michael Welsh Duggan
2021-02-18  9:47 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-02-18 10:14   ` Pip Cet
2021-02-18 10:29     ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-02-18 14:34     ` Eli Zaretskii
2021-02-19 13:31       ` Pip Cet
2021-02-19 13:48         ` Eli Zaretskii
2021-02-19 14:26           ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-02-20  4:35           ` Pip Cet
2021-02-20  8:56             ` Eli Zaretskii
2021-02-20  9:15               ` Pip Cet
2021-02-20 11:21                 ` Eli Zaretskii
2021-02-20 11:48                   ` Eli Zaretskii
2021-02-20 12:03                     ` Pip Cet
2021-02-20 12:42                       ` Eli Zaretskii
2021-02-20 17:00                         ` Pip Cet
2021-02-20 17:18                           ` Eli Zaretskii
2021-02-20 15:42                   ` Stefan Monnier [this message]
2021-02-20 17:02                     ` Pip Cet
2021-02-20 17:12                       ` Stefan Monnier
     [not found]                         ` <jwvo8etr7hf.fsf-monnier+emacs@gnu.org>
2021-04-05  2:56                           ` Michael Welsh Duggan
2021-02-18 14:55   ` Michael Welsh Duggan
2021-02-18 15:12     ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwv5z2mzr24.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=46502@debbugs.gnu.org \
    --cc=akrl@sdf.org \
    --cc=mwd@md5i.com \
    --cc=pipcet@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).