From: Alexey Dejneka Date: Wed, 2 Apr 2003 10:20:21 +0000 (+0000) Subject: 0.pre8.26: X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=ed85afcccb1d054691bcc7ed2242ad0257d251a0;p=sbcl.git 0.pre8.26: * 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; --- diff --git a/BUGS b/BUGS index ba66d02..f98f768 100644 --- 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) diff --git a/OPTIMIZATIONS b/OPTIMIZATIONS index 2b2d63b..a89eb5a 100644 --- a/OPTIMIZATIONS +++ b/OPTIMIZATIONS @@ -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) -------------------------------------------------------------------------------- diff --git a/src/compiler/ir1opt.lisp b/src/compiler/ir1opt.lisp index 8607e68..640468e 100644 --- a/src/compiler/ir1opt.lisp +++ b/src/compiler/ir1opt.lisp @@ -214,6 +214,11 @@ ~% ~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)) diff --git a/src/compiler/ir1util.lisp b/src/compiler/ir1util.lisp index 946c32b..f9884bd 100644 --- a/src/compiler/ir1util.lisp +++ b/src/compiler/ir1util.lisp @@ -1132,7 +1132,10 @@ (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 diff --git a/version.lisp-expr b/version.lisp-expr index 49dc1f0..f701bd9 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -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"