From: Alexey Dejneka Date: Mon, 13 Jun 2005 16:36:02 +0000 (+0000) Subject: 0.9.1.41: X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=636f24460849bdd73284750463439f73d90428ae;p=sbcl.git 0.9.1.41: * BIT-* functions are not foldable (reported by Paul F. Dietz). --- diff --git a/BUGS b/BUGS index b8848f9..a6fca6d 100644 --- a/BUGS +++ b/BUGS @@ -2072,3 +2072,14 @@ WORKAROUND: getting less ambitious about detecting shared list structure, or implementing the moral equivalent of EQUAL hash tables in a cycle-tolerant way. + +382: externalization unexpectedly changes array simplicity + COMPILE-FILE and LOAD + (defun foo () + (let ((x #.(make-array 4 :fill-pointer 0))) + (values (eval `(typep ',x 'simple-array)) + (typep x 'simple-array)))) + then (FOO) => T, NIL. + + Similar problems exist with SIMPLE-ARRAY-P, ARRAY-HEADER accessors + and all array dimension functions. diff --git a/NEWS b/NEWS index 78b18d7..b6a6b06 100644 --- a/NEWS +++ b/NEWS @@ -21,6 +21,9 @@ changes in sbcl-0.9.2 relative to sbcl-0.9.1: Sascha Wilde) * bug fix: more cleanups to the floating point exception handling on x86-64 (thanks to James Knight) + * bug fix: the compiler does not try to constant fold calls of + COERCE and BIT-* functions when they return freshly constructed + objects. (reported by Nikodemus Siivola and Paul Dietz) * optimization: improved the MIPS versions of generic (in the generic sense) arithmetic routines. (thanks to Thiemo Seufer) * optimization: direct conversion of (unsigned-byte 32) to floats on diff --git a/src/compiler/fndb.lisp b/src/compiler/fndb.lisp index 5225b60..151d30c 100644 --- a/src/compiler/fndb.lisp +++ b/src/compiler/fndb.lisp @@ -811,12 +811,12 @@ bit-orc1 bit-orc2) ((array bit) (array bit) &optional (or (array bit) (member t nil))) (array bit) - (foldable) + () #|:derive-type #'result-type-last-arg|#) (defknown bit-not ((array bit) &optional (or (array bit) (member t nil))) (array bit) - (foldable) + () #|:derive-type #'result-type-last-arg|#) (defknown bit-vector-= (bit-vector bit-vector) boolean diff --git a/tests/compiler.impure-cload.lisp b/tests/compiler.impure-cload.lisp index c82bef3..41d0525 100644 --- a/tests/compiler.impure-cload.lisp +++ b/tests/compiler.impure-cload.lisp @@ -420,5 +420,27 @@ (incf (aref x 0)) (assert (equalp x #(2 11)))) +;;; and BIT-* too (reported by Paul F. Dietz) +(loop with v1 = #*0011 + and v2 = #*0101 + for f in '(bit-and bit-andc1 bit-andc2 bit-eqv + bit-ior bit-nand bit-nor bit-not + bit-orc1 bit-orc2 bit-xor + ) + for form = `(lambda () + (let ((v (,f ,v1 ,v2))) + (setf (aref v 0) (- 1 (aref v 0))) + (aref v 0))) + for compiled-res = (funcall (compile nil form)) + for real-res = (- 1 (aref (funcall f v1 v2) 0)) + do (assert (equal compiled-res real-res))) +(let* ((v #*0011) + (form `(lambda () + (let ((v (bit-not ,v))) + (setf (aref v 0) (- 1 (aref v 0))) + (aref v 0)))) + (compiled-res (funcall (compile nil form))) + (real-res (- 1 (aref (funcall (eval #'bit-not) v) 0)))) + (assert (equal compiled-res real-res))) (sb-ext:quit :unix-status 104) diff --git a/version.lisp-expr b/version.lisp-expr index 3e087f9..0fe1c4e 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".) -"0.9.1.40" +"0.9.1.41"