0.8.5.5:
authorAlexey Dejneka <adejneka@comail.ru>
Sun, 26 Oct 2003 11:36:24 +0000 (11:36 +0000)
committerAlexey Dejneka <adejneka@comail.ru>
Sun, 26 Oct 2003 11:36:24 +0000 (11:36 +0000)
        * Fix bug reported by Brian Downing: do not perform
          MV-LET-convertion, if the last optional entry has
          references.
        ... new consistency condition: function in a local
            mv-combination must be of kind MV-LET.

NEWS
src/compiler/debug.lisp
src/compiler/locall.lisp
tests/compiler.impure-cload.lisp
version.lisp-expr

diff --git a/NEWS b/NEWS
index f5bbce8..ebf76c7 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -2173,6 +2173,8 @@ changes in sbcl-0.8.6 relative to sbcl-0.8.5:
     that the various BOOLE-related constants have the same value in
     host and target lisps.  (noted by Paul Dietz' test suite on an
     SBCL binary built from CLISP)
+  * fixed a compiler bug: MV-LET convertion did not check references
+    to the "max args" entry point.  (reported by Brian Downing)
 
 planned incompatible changes in 0.8.x:
   * (not done yet, but planned:) When the profiling interface settles
index 9be0b07..ac06242 100644 (file)
             (check-fun-reached leaf node)))))
     (basic-combination
      (check-dest (basic-combination-fun node) node)
+     (when (and (mv-combination-p node)
+                (eq (basic-combination-kind node) :local))
+       (let ((fun-lvar (basic-combination-fun node)))
+         (unless (ref-p (lvar-uses fun-lvar))
+           (barf "function in a local mv-combination is not a LEAF: ~S" node))
+         (let ((fun (ref-leaf (lvar-use fun-lvar))))
+           (unless (lambda-p fun)
+             (barf "function ~S in a local mv-combination ~S is not local"
+                   fun node))
+           (unless (eq (functional-kind fun) :mv-let)
+             (barf "function ~S in a local mv-combination ~S is not of kind :MV-LET"
+                   fun node)))))
      (dolist (arg (basic-combination-args node))
        (cond
          (arg (check-dest arg node))
index a4bf8fa..3239cd3 100644 (file)
 (defun convert-mv-call (ref call fun)
   (declare (type ref ref) (type mv-combination call) (type functional fun))
   (when (and (looks-like-an-mv-bind fun)
-            (not (functional-entry-fun fun))
             (singleton-p (leaf-refs fun))
             (singleton-p (basic-combination-args call)))
     (let* ((*current-component* (node-component ref))
            (ep (optional-dispatch-entry-point-fun
                 fun (optional-dispatch-max-args fun))))
-      (aver (= (optional-dispatch-min-args fun) 0))
-      (setf (basic-combination-kind call) :local)
-      (pushnew ep (lambda-calls-or-closes (node-home-lambda call)))
-      (merge-tail-sets call ep)
-      (change-ref-leaf ref ep)
+      (when (null (leaf-refs ep))
+        (aver (= (optional-dispatch-min-args fun) 0))
+        (aver (not (functional-entry-fun fun)))
+        (setf (basic-combination-kind call) :local)
+        (pushnew ep (lambda-calls-or-closes (node-home-lambda call)))
+        (merge-tail-sets call ep)
+        (change-ref-leaf ref ep)
 
-      (assert-lvar-type
-       (first (basic-combination-args call))
-       (make-short-values-type (mapcar #'leaf-type (lambda-vars ep)))
-       (lexenv-policy (node-lexenv call)))))
+        (assert-lvar-type
+         (first (basic-combination-args call))
+         (make-short-values-type (mapcar #'leaf-type (lambda-vars ep)))
+         (lexenv-policy (node-lexenv call))))))
   (values))
 
 ;;; Attempt to convert a call to a lambda. If the number of args is
index 531f1b6..2967dfc 100644 (file)
   (dotimes (k n)
     (princ k)))
 
+;;; bug reported by Brian Downing: incorrect detection of MV-LET
+(DEFUN #:failure-testcase (SESSION)
+  (LABELS ((CONTINUATION-1 ()
+             (PROGN
+               (IF (foobar-1 SESSION)
+                   (CONTINUATION-2))
+               (LET ((CONTINUATION-3
+                      #'(LAMBDA ()
+                          (MULTIPLE-VALUE-CALL #'CONTINUATION-2
+                            (CONTINUATION-1)))))
+                 (foobar-2 CONTINUATION-3))))
+           (CONTINUATION-2 (&REST OTHER-1)
+             (DECLARE (IGNORE OTHER-1))))
+    (continuation-1)))
+
 \f
 (sb-ext:quit :unix-status 104)
index 4455e27..ab40d4c 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.5.4"
+"0.8.5.5"