0.pre8.26:
authorAlexey Dejneka <adejneka@comail.ru>
Wed, 2 Apr 2003 10:20:21 +0000 (10:20 +0000)
committerAlexey Dejneka <adejneka@comail.ru>
Wed, 2 Apr 2003 10:20:21 +0000 (10:20 +0000)
        * Fixed bug reported by Robert E. Brown on sbcl-devel
          2003-01-21 (optimization issue 10)
          ** DERIVE-NODE-TYPE replaces references to lambda variables
             of type (EQL x) with a constant reference to x;
          ** UNLINK-NODE checks for a possibility of IF optimization;

BUGS
OPTIMIZATIONS
src/compiler/ir1opt.lisp
src/compiler/ir1util.lisp
version.lisp-expr

diff --git a/BUGS b/BUGS
index ba66d02..f98f768 100644 (file)
--- a/BUGS
+++ b/BUGS
@@ -684,7 +684,8 @@ WORKAROUND:
   expansion, leaving garbage consisting of infinished blocks of the
   partially converted function.)
 
-  (appears to be fixed in sbcl-0.pre8.21)
+  (due to reordering of the compiler this example is compiled
+  successfully by 0.7.14, but the bug probably remains)
 
 162:
   (reported by Robert E. Brown 2002-04-16) 
index 2b2d63b..a89eb5a 100644 (file)
@@ -147,25 +147,5 @@ This code could be optimized to
 #10
 Reported by Robert E. Brown on sbcl-devel 2003-01-21:
 
-(defstruct trace-info
-  (foo nil :type (or null function)))
-
-(defun bad (x)
-  (declare (optimize (speed 3) (safety 0)))
-  (let ((wow (trace-info-foo x)))
-    (or (not wow) (funcall wow 1 2 3))))
-
-Python does not derive that FUNCALL is applied to FUNCTION.
-
-(OR ...) is equivalent to
-
-(LET ((G2407 (NOT WOW)))
-  (IF G2407 G2407 (FUNCALL WOW 1 2 3)))
-
-or to
-
-(LET ((G2407 (IF WOW NIL T)))
-  (IF G2407 G2407 (FUNCALL WOW 1 2 3)))
-
-so this is similar to #9.
+(this is really a bug, fixed in 0.pre8.26)
 --------------------------------------------------------------------------------
index 8607e68..640468e 100644 (file)
                ~%  ~S~%*** possible internal error? Please report this."
               (type-specifier rtype) (type-specifier node-type))))
          (setf (node-derived-type node) int)
+          (when (and (ref-p node)
+                     (member-type-p int)
+                     (null (rest (member-type-members int)))
+                     (lambda-var-p (ref-leaf node)))
+            (change-ref-leaf node (find-constant (first (member-type-members int)))))
          (reoptimize-continuation (node-cont node))))))
   (values))
 
index 946c32b..f9884bd 100644 (file)
                  (setf (continuation-next prev) nil))
                 (t
                  (setf (continuation-next prev) next)
-                 (setf (node-prev next) prev)))
+                 (setf (node-prev next) prev)
+                  (when (and (if-p next) ; AOP wanted
+                             (eq prev (if-test next)))
+                    (reoptimize-continuation prev))))
           (setf (node-prev node) nil)
           nil)
          (t
index 49dc1f0..f701bd9 100644 (file)
@@ -18,4 +18,4 @@
 ;;; versions, especially for internal versions off the main CVS
 ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
 
-"0.pre8.25"
+"0.pre8.26"