bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#46502: 28.0.50; [feature/native-comp] (d3a399dd) native-comp bootstr


From: Stefan Monnier
Subject: bug#46502: 28.0.50; [feature/native-comp] (d3a399dd) native-comp bootstrap failure
Date: Sat, 20 Feb 2021 10:42:34 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

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






reply via email to

[Prev in Thread] Current Thread [Next in Thread]