From: Nikodemus Siivola Date: Thu, 15 May 2008 16:10:02 +0000 (+0000) Subject: 1.0.16.32: revert ANY-REG from registers for primitive type T on x86oids X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=389b5755b2eab960c1f4c14045a26de5dbd510c1;p=sbcl.git 1.0.16.32: revert ANY-REG from registers for primitive type T on x86oids * While register sets for DESCRIPTOR-REG and ANY-REG are identical on x86 and x86-64, the compiler reasons about them a bit differently -- so the earlier change is wrong, and caused a regression. * Test-case to catch the regression, reduced from Elephant sources. * Record the bug the earlier change tried to address as #427. --- diff --git a/BUGS b/BUGS index d503d80..de89345 100644 --- a/BUGS +++ b/BUGS @@ -1958,3 +1958,13 @@ generally try to check returns in safe code, so we should here too.) second nested one. A trivial fix is to call CHANGE-REF-LEAF in known call for functions already inline converted there, but he is not sure if this has adverse effects elsewhere. + +427: ANY-REG not good for primitive type T + + ...which is true, of course, but the following should not complain + about it (on x86 and x86-64): + + (sb-alien:with-alien ((buf (array (sb-alien:signed 8) 16)))) + + reported by Stelian Ionescu on sbcl-devel. + diff --git a/NEWS b/NEWS index 4da4bff..18d415f 100644 --- a/NEWS +++ b/NEWS @@ -15,9 +15,6 @@ changes in sbcl-1.0.17 relative to 1.0.16: in normal SPEED policies. * bug fix: result of MAKE-ARRAY can be stack allocated - regression since 1.0.15.36. (thanks to Paul Khuong) - * bug fix: bogus errors when generating certain code sequences, due - to the compiler not accepting ANY-REG for primitive type T on x86 - and x86-64. (reported by Stelian Ionescu.) * bug fix: LAST when always returned the whole list when given a bignum as the second argument. * bug fix: dynamic extent allocation of nested lists and vectors diff --git a/src/compiler/generic/primtype.lisp b/src/compiler/generic/primtype.lisp index 561114c..2ee50b0 100644 --- a/src/compiler/generic/primtype.lisp +++ b/src/compiler/generic/primtype.lisp @@ -16,7 +16,7 @@ (/show0 "primtype.lisp 17") -(!def-primitive-type t (descriptor-reg #!+(or x86 x86-64) any-reg)) +(!def-primitive-type t (descriptor-reg)) (/show0 "primtype.lisp 20") (setf *backend-t-primitive-type* (primitive-type-or-lose t)) diff --git a/tests/alien.impure.lisp b/tests/alien.impure.lisp index c85ee8e..d1ee3e3 100644 --- a/tests/alien.impure.lisp +++ b/tests/alien.impure.lisp @@ -203,8 +203,4 @@ (error () :ok))))) -;; This used to signal an error on x86 due to primitive type T not having -;; been compatible with ANY-REG. (On x86 and -64 ANY-REG is fine.) -(sb-alien:with-alien ((buf (array (sb-alien:signed 8) 16)))) - ;;; success diff --git a/tests/compiler.pure.lisp b/tests/compiler.pure.lisp index b5df3b9..9b5289d 100644 --- a/tests/compiler.pure.lisp +++ b/tests/compiler.pure.lisp @@ -2350,3 +2350,21 @@ (the ,type x))))) (compile nil (make-lambda 'list)) (compile nil (make-lambda 'vector)))))) + +;;; this caused a momentary regression when an ill-adviced fix to +;;; bug 427 made ANY-REG suitable for primitive-type T: +;;; +;;; no :MOVE-ARG VOP defined to move # (SC SB-VM::SINGLE-REG) to # (SC SB-VM::ANY-REG) +;;; [Condition of type SIMPLE-ERROR] +(compile nil + '(lambda (frob) + (labels + ((%zig (frob) + (typecase frob + (double-float + (setf (sb-alien:deref (sb-alien:cast (sb-alien:sap-alien (unknown1) (* unsigned-char)) + (* double-float))) frob)) + (hash-table + (%zig (the (values (single-float (0.0) 1.0) &optional) (unknown2))) + nil)))) + (%zig)))) diff --git a/version.lisp-expr b/version.lisp-expr index c8f36ec..b56b2e5 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.16.31" +"1.0.16.32"