1.0.7.9: DEFAULT-UNKNOWN-VALUES for more than 7 args on x86-64
authorChristophe Rhodes <csr21@cantab.net>
Mon, 2 Jul 2007 16:58:20 +0000 (16:58 +0000)
committerChristophe Rhodes <csr21@cantab.net>
Mon, 2 Jul 2007 16:58:20 +0000 (16:58 +0000)
Convinced myself that my patch was right, and that JMP-SHORT was
an artifact of the previous calling convention.  Delete
the JMP-SHORT pseudo-instruction forthwith.

NEWS
src/compiler/x86-64/call.lisp
src/compiler/x86-64/insts.lisp
tests/compiler-2.impure-cload.lisp
tests/compiler.impure.lisp
version.lisp-expr

diff --git a/NEWS b/NEWS
index 5d99bb6..10d300e 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -15,6 +15,8 @@ changes in sbcl-1.0.8 relative to sbcl-1.0.7:
   * bug fix: backtrace construction is now more careful when making
     lisp-objects from pointers on the stack, to avoid creating bogus
     objects that can be seen by the GC.
+  * bug fix: defaulting of values in contexts expecting more than 7
+    variables now works on x86-64.  (reported by Christopher Laux)
 
 changes in sbcl-1.0.7 relative to sbcl-1.0.6:
   * MOP improvement: support for user-defined subclasses of
index 269b8c6..bd61005 100644 (file)
           (count-okay (gen-label)))
       (note-this-location vop :unknown-return)
       ;; Branch off to the MV case.
-      (inst nop)
-      (inst jmp-short regs-defaulted)
+      (inst jmp :c regs-defaulted)
 
       ;; Default the register args, and set up the stack as if we
       ;; entered the MV return point.
index 5937993..4179980 100644 (file)
           (emit-byte segment #b11111111)
           (emit-ea segment where #b100)))))
 
-(define-instruction jmp-short (segment label)
-  (:emitter
-   (emit-byte segment #b11101011)
-   (emit-byte-displacement-backpatch segment label)))
-
 (define-instruction ret (segment &optional stack-delta)
   (:printer byte ((op #b11000011)))
   (:printer byte ((op #b11000010) (imm nil :type 'imm-word-16))
index f2c690e..815a695 100644 (file)
@@ -18,8 +18,8 @@
 
 ;;;; These three forms should be equivalent.
 
-;;;; This used to be a bug in the handling of null-lexenv vs toplevel
-;;;; policy: LOCALLY and MACROLET hid the toplevel policy from view.
+;;; This used to be a bug in the handling of null-lexenv vs toplevel
+;;; policy: LOCALLY and MACROLET hid the toplevel policy from view.
 
 (locally
     (defun foo (n)
@@ -51,9 +51,9 @@
 (assert (equal (test) '(0 0 0)))
 (assert (equal (test) '(13 13 13))) ; sanity check
 
-;; Bug in 1.0.2 and 1.0.3, where the XEP was compiled with the wrong
-;; policy. (Test-case derived from code posted by alexander.ekart in
-;; comp.lang.lisp).
+;;; Bug in 1.0.2 and 1.0.3, where the XEP was compiled with the wrong
+;;; policy. (Test-case derived from code posted by alexander.ekart in
+;;; comp.lang.lisp).
 
 (locally
     (declare (optimize (safety 0)))
@@ -64,4 +64,3 @@
     (aref x y)))
 
 (assert (raises-error? (bubblesort (make-array 10) 9)))
-
index 2d95261..ebd0b72 100644 (file)
                        (declare (optimize debug))
                        (list x y z)))))
 
+;;; long-standing bug in defaulting unknown values on the x86-64,
+;;; since changing the calling convention (test case by Christopher
+;;; Laux sbcl-help 30-06-2007)
+
+(defun default-values-bug-demo-sub ()
+  (format t "test")
+  nil)
+(compile 'default-values-bug-demo-sub)
+
+(defun default-values-bug-demo-main ()
+  (multiple-value-bind (a b c d e f g h)
+      (default-values-bug-demo-sub)
+    (if a (+ a b c d e f g h) t)))
+(compile 'default-values-bug-demo-main)
+
+(assert (default-values-bug-demo-main))
+
 ;;; success
index 40987ae..63f3ca6 100644 (file)
@@ -17,4 +17,4 @@
 ;;; checkins which aren't released. (And occasionally for internal
 ;;; versions, especially for internal versions off the main CVS
 ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"1.0.7.8"
+"1.0.7.9"