Skip to content

Commit

Permalink
1.0.7.9: DEFAULT-UNKNOWN-VALUES for more than 7 args on x86-64
Browse files Browse the repository at this point in the history
	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.
  • Loading branch information
csrhodes committed Jul 2, 2007
1 parent 5465e5e commit e0a4fab
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 14 deletions.
2 changes: 2 additions & 0 deletions NEWS
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions src/compiler/x86-64/call.lisp
Expand Up @@ -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.
Expand Down
5 changes: 0 additions & 5 deletions src/compiler/x86-64/insts.lisp
Expand Up @@ -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))
Expand Down
11 changes: 5 additions & 6 deletions tests/compiler-2.impure-cload.lisp
Expand Up @@ -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)
Expand Down Expand Up @@ -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)))
Expand All @@ -64,4 +64,3 @@
(aref x y)))

(assert (raises-error? (bubblesort (make-array 10) 9)))

17 changes: 17 additions & 0 deletions tests/compiler.impure.lisp
Expand Up @@ -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
2 changes: 1 addition & 1 deletion version.lisp-expr
Expand Up @@ -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"

0 comments on commit e0a4fab

Please sign in to comment.