master: Fix specialized XEPs with ignored parameters, again

stassats via Sbcl-commits <[email protected]>
Newsgroups gmane.lisp.steel-bank.cvs
Message-ID <[email protected]>
The branch "master" has been updated in SBCL:
       via  06df2ad72b00014341d066afe4984e4ae6d374e5 (commit)
      from  e96684a5e732b5816d8145259b485b9f030848ff (commit)

- Log -----------------------------------------------------------------
commit 06df2ad72b00014341d066afe4984e4ae6d374e5
Author: Stas Boukarev <[email protected]>
Date:   Tue Aug 11 17:53:31 2026 +0300

    Fix specialized XEPs with ignored parameters, again
    
    Reported by Sylvia Harrington.
---
 src/compiler/ir2tran.lisp    | 20 +++++++++++---------
 tests/compiler-2.impure.lisp |  9 +++++----
 2 files changed, 16 insertions(+), 13 deletions(-)

diff --git a/src/compiler/ir2tran.lisp b/src/compiler/ir2tran.lisp
index 41cb4c2e4..2b7922cb3 100644
--- a/src/compiler/ir2tran.lisp
+++ b/src/compiler/ir2tran.lisp
@@ -1560,15 +1560,17 @@
             (emit-move node block arg-count-tn (leaf-info (first vars))))
           (dolist (arg (rest vars))
             (let ((arg-type (pop arg-types)))
-              (when (leaf-refs arg)
-                (let ((pass (if fixed-arg-state
-                                (sb-vm::fixed-call-arg-location arg-type fixed-arg-state)
-                                (standard-arg-location n)))
-                      (home (leaf-info arg)))
-                  (if (and (lambda-var-indirect arg)
-                           (lambda-var-explicit-value-cell arg))
-                      (emit-make-value-cell node block pass home)
-                      (emit-move node block pass home)))))
+              (if (leaf-refs arg)
+                  (let ((pass (if fixed-arg-state
+                                  (sb-vm::fixed-call-arg-location arg-type fixed-arg-state)
+                                  (standard-arg-location n)))
+                        (home (leaf-info arg)))
+                    (if (and (lambda-var-indirect arg)
+                             (lambda-var-explicit-value-cell arg))
+                        (emit-make-value-cell node block pass home)
+                        (emit-move node block pass home)))
+                  (when fixed-arg-state
+                    (sb-vm::fixed-call-arg-location arg-type fixed-arg-state))))
             (incf n)))))
     #-fp-and-pc-standard-save
     (emit-move node block (make-old-fp-passing-location)
diff --git a/tests/compiler-2.impure.lisp b/tests/compiler-2.impure.lisp
index 55ea3c6f8..4111b1b26 100644
--- a/tests/compiler-2.impure.lisp
+++ b/tests/compiler-2.impure.lisp
@@ -248,16 +248,17 @@
            (lambda () (values m (incf j)))))))))
 
 
-(declaim (ftype (function (t double-float)) specialized-xep-ignored-var))
-(defun specialized-xep-ignored-var (a d)
+(declaim (ftype (function (t double-float t)) specialized-xep-ignored-var))
+(defun specialized-xep-ignored-var (a d b)
   (declare (ignore a))
-  d)
+  (when (zerop b)
+    d))
 
 (with-test (:name :specialized-xep-ignored-var)
  (checked-compile-and-assert
   ()
   `(lambda (d)
-     (specialized-xep-ignored-var 1 d))
+     (specialized-xep-ignored-var 1 d 0))
   ((2d0) 2d0)
   ((-2d0) -2d0)))
 

-----------------------------------------------------------------------


hooks/post-receive
-- 
SBCL
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.