0.8.0.59:
authorChristophe Rhodes <csr21@cam.ac.uk>
Tue, 10 Jun 2003 11:08:09 +0000 (11:08 +0000)
committerChristophe Rhodes <csr21@cam.ac.uk>
Tue, 10 Jun 2003 11:08:09 +0000 (11:08 +0000)
Make VALUES derive type optimizer accurate:
... since we have this nice interpretation of VALUES types, use
it in the VALUES derive-type optimizer -- we will return
exactly as many values as VALUES has arguments;
... fix the bugs that this reveals in sbcl; :-)
... enables us to detect more bogosity: test for some more type
mismatches being caught.
... (relatedly) fix one more duplicate definition in
sb-bsd-sockets
Array initializer type warning fix:
... don't do (csubtypep (ctype-of x) eltype), because that's wrong
for e.g. X = #\a and eltype being STANDARD-CHAR; use
CTYPEP instead.

NEWS
contrib/sb-bsd-sockets/constants.lisp
src/compiler/array-tran.lisp
src/compiler/generic/vm-fndb.lisp
src/compiler/generic/vm-tran.lisp
src/compiler/info-functions.lisp
src/compiler/srctran.lisp
tests/compiler.test.sh
version.lisp-expr

diff --git a/NEWS b/NEWS
index 98e5991..b4e3018 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1834,6 +1834,8 @@ changes in sbcl-0.8.1 relative to sbcl-0.8.0:
     ** FIND-METHOD signals an error if the lengths of the specializers
        is incompatible with the generic function, even if the ERRORP
        argument is true.
+    ** TYPE-OF returns recognizeable subtypes of all built-in-types of
+       which its argument is a member.
 
 planned incompatible changes in 0.8.x:
   * (not done yet, but planned:) When the profiling interface settles
index e52aab1..2629aef 100644 (file)
                                           (addr (* t))
                                           (len integer)
                                           (af integer)))
- (:structure hostent ("struct hostent"
-                      ((* t) name "char *" "h_name")
-                      (integer length "int" "h_length")))
-
  (:function setsockopt ("setsockopt" integer
                         (socket integer)
                         (level integer)
index 724440d..adca769 100644 (file)
           (when (constant-continuation-p initial-element)
             (let ((value (continuation-value initial-element)))
               (cond
-                ((not (csubtypep (ctype-of value)
-                                 (saetp-ctype saetp)))
+                ((not (ctypep value (saetp-ctype saetp)))
                  ;; this case will cause an error at runtime, so we'd
                  ;; better WARN about it now.
                  (compiler-warn "~@<~S is not a ~S (which is the ~
                                 value
                                 (type-specifier (saetp-ctype saetp))
                                 eltype))
-                ((not (csubtypep (ctype-of value) eltype-type))
+                ((not (ctypep value eltype-type))
                  ;; this case will not cause an error at runtime, but
                  ;; it's still worth STYLE-WARNing about.
                  (compiler-style-warn "~S is not a ~S."
index 2a4857b..edfd9da 100644 (file)
 
 (defknown copy-to-system-area
          ((simple-unboxed-array (*)) index system-area-pointer index index)
-  null
+  (values)
   ())
 
 (defknown copy-from-system-area
          (system-area-pointer index (simple-unboxed-array (*)) index index)
-  null
+  (values)
   ())
 
 (defknown system-area-copy
          (system-area-pointer index system-area-pointer index index)
-  null
+  (values)
   ())
 
 (defknown bit-bash-copy
          ((simple-unboxed-array (*)) index
           (simple-unboxed-array (*)) index index)
-  null
+  (values)
   ())
 
 ;;; (not really a bit-bashing routine, but starting to take over from
 (defknown %byte-blt
   ((or (simple-unboxed-array (*)) system-area-pointer) index
    (or (simple-unboxed-array (*)) system-area-pointer) index index)
-  null
+  (values)
   ())
 \f
 ;;;; code/function/fdefn object manipulation routines
index 7c4cc00..852a086 100644 (file)
       (memmove (sap+ (sapify dst) dst-start)
               (sap+ (sapify src) src-start)
               (- dst-end dst-start)))
-     nil))
+     (values)))
 \f
 ;;;; transforms for EQL of floating point values
 
index a5abe11..b4f3c2e 100644 (file)
        (typecase x
         (structure-class (values (info :type :documentation (class-name x))))
         (t (and (typep x 'symbol) (values (info :type :documentation x))))))
-      (setf (info :setf :documentation x))
+      (setf (values (info :setf :documentation x)))
       ((t)
        (typecase x
         (function (%fun-doc x))
index 124d841..ac6527a 100644 (file)
   (values-specifier-type
    `(values ,@(mapcar (lambda (x)
                        (type-specifier (continuation-type x)))
-                     values))))
+                     values)
+            &optional)))
 \f
 ;;;; byte operations
 ;;;;
index 409e0b9..87ca1c1 100644 (file)
@@ -155,7 +155,8 @@ cat > $tmpfilename <<EOF
 EOF
 expect_clean_compile $tmpfilename
 
-# This in an ideal world would fail, but at present it doesn't.
+# This in an ideal world would fail (that is, return with FAILURE-P
+# set), but at present it doesn't.
 cat > $tmpfilename <<EOF
     (in-package :cl-user)
     (defun foo (x) (list x))
@@ -167,6 +168,24 @@ cat > $tmpfilename <<EOF
 EOF
 # expect_failed_compile $tmpfilename
 
+# This used to not warn, because the VALUES derive-type optimizer was
+# insufficiently precise.
+cat > $tmpfilename <<EOF
+    (in-package :cl-user)
+    (defun foo (x) (declare (ignore x)) (values))
+    (defun bar (x) (1+ (foo x)))
+EOF
+expect_failed_compile $tmpfilename
+
+# Even after making the VALUES derive-type optimizer more precise, the
+# following should still be clean.
+cat > $tmpfilename <<EOF
+    (in-package :cl-user)
+    (defun foo (x) (declare (ignore x)) (values))
+    (defun bar (x) (car x))
+EOF
+expect_clean_compile $tmpfilename
+
 rm $tmpfilename
 rm $compiled_tmpfilename
 
index a85530d..3a3a291 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".)
-"0.8.0.58"
+"0.8.0.59"