summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lisp/emacs-lisp/byte-run.el8
-rw-r--r--test/src/comp-test-funcs.el3
-rw-r--r--test/src/comp-tests.el4
3 files changed, 11 insertions, 4 deletions
diff --git a/lisp/emacs-lisp/byte-run.el b/lisp/emacs-lisp/byte-run.el
index 042a26a2e31..1bc78391886 100644
--- a/lisp/emacs-lisp/byte-run.el
+++ b/lisp/emacs-lisp/byte-run.el
@@ -363,13 +363,13 @@ You don't need this. (See bytecomp.el commentary for more details.)
(or (memq (get name 'byte-optimizer)
'(nil byte-compile-inline-expand))
(error "`%s' is a primitive" name))
- ;; Never native-compile defsubsts as we need the byte
- ;; definition in `byte-compile-unfold-bcf' to perform the
- ;; inlining (Bug#42664).
- (byte-run--set-speed name nil -1)
`(prog1
(defun ,name ,arglist ,@body)
(eval-and-compile
+ ;; Never native-compile defsubsts as we need the byte
+ ;; definition in `byte-compile-unfold-bcf' to perform the
+ ;; inlining (Bug#42664, Bug#43280, Bug#44209).
+ ,(byte-run--set-speed name nil -1)
(put ',name 'byte-optimizer 'byte-compile-inline-expand))))
(defvar advertised-signature-table (make-hash-table :test 'eq :weakness 'key))
diff --git a/test/src/comp-test-funcs.el b/test/src/comp-test-funcs.el
index 9285ed62c2a..35df46a9b84 100644
--- a/test/src/comp-test-funcs.el
+++ b/test/src/comp-test-funcs.el
@@ -345,6 +345,9 @@
(declare (speed 2))
(- x y))
+(defsubst comp-test-defsubst-f ()
+ t)
+
;;;;;;;;;;;;;;;;;;;;
;; Tromey's tests ;;
diff --git a/test/src/comp-tests.el b/test/src/comp-tests.el
index b9a0a8771e5..ae96e5d3868 100644
--- a/test/src/comp-tests.el
+++ b/test/src/comp-tests.el
@@ -426,6 +426,10 @@ https://lists.gnu.org/archive/html/bug-gnu-emacs/2020-03/msg00914.html."
(should (subr-native-elisp-p f))
(should (= (funcall f 2) 3))))
+(comp-deftest comp-test-defsubst ()
+ ;; Bug#42664, Bug#43280, Bug#44209.
+ (should-not (subr-native-elisp-p (symbol-function #'comp-test-defsubst-f))))
+
;;;;;;;;;;;;;;;;;;;;;
;; Tromey's tests. ;;