0.8.0.71:
authorAlexey Dejneka <adejneka@comail.ru>
Sat, 14 Jun 2003 17:15:29 +0000 (17:15 +0000)
committerAlexey Dejneka <adejneka@comail.ru>
Sat, 14 Jun 2003 17:15:29 +0000 (17:15 +0000)
        * Merged in Robert E. Brown's patch for the bug 235b;
        * MAKE-ARRAY: in complex case infer a dimension.

BUGS
NEWS
src/compiler/array-tran.lisp
src/compiler/seqtran.lisp
tests/compiler.pure.lisp
version.lisp-expr

diff --git a/BUGS b/BUGS
index 2227e4c..e4dd346 100644 (file)
--- a/BUGS
+++ b/BUGS
@@ -721,8 +721,8 @@ WORKAROUND:
      lists and &KEY arguments) do not signal errors when they should.
 
 
-201: "Incautious type inference from compound CONS types"
-  (reported by APD sbcl-devel 2002-09-17)
+201: "Incautious type inference from compound types"
+  a. (reported by APD sbcl-devel 2002-09-17)
     (DEFUN FOO (X)
       (LET ((Y (CAR (THE (CONS INTEGER *) X))))
         (SETF (CAR X) NIL)
@@ -735,6 +735,17 @@ WORKAROUND:
 
     (FOO ' (1 . 2)) => "NIL IS INTEGER, Y = 1"
 
+  b.
+    * (defun foo (x)
+        (declare (type (array * (4 4)) x))
+        (let ((y x))
+          (setq x (make-array '(4 4)))
+          (adjust-array y '(3 5))
+          (= (array-dimension y 0) (eval `(array-dimension ,y 0)))))
+    FOO
+    * (foo (make-array '(4 4) :adjustable t))
+    NIL
+
 205: "environment issues in cross compiler"
   (These bugs have no impact on user code, but should be fixed or
   documented.)
@@ -930,17 +941,6 @@ WORKAROUND:
 
   (foo '(nil) '(t)) => NIL, T.
 
-  b. (reported by brown on #lisp 2003-01-21)
-
-    (defun find-it (x)
-      (declare (optimize (speed 3) (safety 0)))
-      (declare (notinline mapcar))
-      (let ((z (mapcar #'car x)))
-        (find 'foobar z)))
-
-  Without (DECLARE (NOTINLINE MAPCAR)), Python cannot derive that Z is
-  LIST.
-
 237: "Environment arguments to type functions"
   a. Functions SUBTYPEP, TYPEP, UPGRADED-ARRAY-ELEMENT-TYPE, and 
      UPGRADED-COMPLEX-PART-TYPE now have an optional environment
diff --git a/NEWS b/NEWS
index cda9759..f25cda5 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1833,6 +1833,8 @@ changes in sbcl-0.8.1 relative to sbcl-0.8.0:
     strings which use variants of the ~* directive inside.
   * bug fix: SEARCH now applies its TEST predicate to the elements of
     the arguments in the correct order.  (thanks to Wolfhard Buss)
+  * fixed bug 235b: compiler uses return types of MAPCAR and friends
+    in type inference.  (thanks to Robert E. Brown)
   * fixed some bugs revealed by Paul Dietz' test suite:
     ** NIL is now allowed as a structure slot name.
     ** arbitrary numbers, not just reals, are allowed in certain
index 9d0df27..07ab5d3 100644 (file)
             ,(cond ((constant-continuation-p dims)
                     (let* ((val (continuation-value dims))
                           (cdims (if (listp val) val (list val))))
-                     (if (or simple (/= (length cdims) 1))
+                     (if simple
                          cdims
-                         '(*))))
+                         (length cdims))))
                    ((csubtypep (continuation-type dims)
                                (specifier-type 'integer))
                     '(*))
index df274b1..82a5fa7 100644 (file)
             `(let ((,fn-sym ,fn)
                    (,map-result (list nil)))
                (do-anonymous ((,temp ,map-result) . ,(do-clauses))
-                             (,endtest (cdr ,map-result))
+                             (,endtest (truly-the list (cdr ,map-result)))
                  (rplacd ,temp (setq ,temp (list ,call)))))))
          ((nil)
           `(let ((,fn-sym ,fn)
                  (,n-first ,(first arglists)))
              (do-anonymous ,(do-clauses)
-                           (,endtest ,n-first) ,call))))))))
+                           (,endtest (truly-the list ,n-first))
+                            ,call))))))))
 
 (define-source-transform mapc (function list &rest more-lists)
   (mapfoo-transform function (cons list more-lists) nil t))
index ae6a645..1178ab8 100644 (file)
                                    (char/= x y z)))
                         nil #\a #\a)
                type-error)
+
+;;; Compiler lost return type of MAPCAR and friends
+(dolist (fun '(mapcar mapc maplist mapl))
+  (assert (nth-value 2 (compile nil
+                                `(lambda (x)
+                                   (1+ (,fun #'print x)))))))
index 6d3862c..9668685 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.70"
+"0.8.0.71"