From: Christophe Rhodes Date: Mon, 2 Jul 2007 16:58:20 +0000 (+0000) Subject: 1.0.7.9: DEFAULT-UNKNOWN-VALUES for more than 7 args on x86-64 X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=e0a4fab15834525fd043e6ef5adfd74a13af1450;p=sbcl.git 1.0.7.9: DEFAULT-UNKNOWN-VALUES for more than 7 args on x86-64 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. --- diff --git a/NEWS b/NEWS index 5d99bb6..10d300e 100644 --- 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 diff --git a/src/compiler/x86-64/call.lisp b/src/compiler/x86-64/call.lisp index 269b8c6..bd61005 100644 --- a/src/compiler/x86-64/call.lisp +++ b/src/compiler/x86-64/call.lisp @@ -285,8 +285,7 @@ (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. diff --git a/src/compiler/x86-64/insts.lisp b/src/compiler/x86-64/insts.lisp index 5937993..4179980 100644 --- a/src/compiler/x86-64/insts.lisp +++ b/src/compiler/x86-64/insts.lisp @@ -2575,11 +2575,6 @@ (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)) diff --git a/tests/compiler-2.impure-cload.lisp b/tests/compiler-2.impure-cload.lisp index f2c690e..815a695 100644 --- a/tests/compiler-2.impure-cload.lisp +++ b/tests/compiler-2.impure-cload.lisp @@ -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))) - diff --git a/tests/compiler.impure.lisp b/tests/compiler.impure.lisp index 2d95261..ebd0b72 100644 --- a/tests/compiler.impure.lisp +++ b/tests/compiler.impure.lisp @@ -1431,4 +1431,21 @@ (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 diff --git a/version.lisp-expr b/version.lisp-expr index 40987ae..63f3ca6 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -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"