1.0.16.32: revert ANY-REG from registers for primitive type T on x86oids
authorNikodemus Siivola <nikodemus@random-state.net>
Thu, 15 May 2008 16:10:02 +0000 (16:10 +0000)
committerNikodemus Siivola <nikodemus@random-state.net>
Thu, 15 May 2008 16:10:02 +0000 (16:10 +0000)
 * 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.

BUGS
NEWS
src/compiler/generic/primtype.lisp
tests/alien.impure.lisp
tests/compiler.pure.lisp
version.lisp-expr

diff --git a/BUGS b/BUGS
index d503d80..de89345 100644 (file)
--- 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 (file)
--- 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
index 561114c..2ee50b0 100644 (file)
@@ -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))
 
index c85ee8e..d1ee3e3 100644 (file)
          (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
index b5df3b9..9b5289d 100644 (file)
                    (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 #<SB-C:TN t1> (SC SB-VM::SINGLE-REG) to #<SB-C:TN t2> (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))))
index c8f36ec..b56b2e5 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.16.31"
+"1.0.16.32"