X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Fir1opt.lisp;h=d585c2076d9903d6f5a6480fbda9488da80c3f0b;hb=98a76d4426660876dec6649b1e228d2e5b47f579;hp=640468e6a6a25090e43b4af5628cbd35921c1d54;hpb=ed85afcccb1d054691bcc7ed2242ad0257d251a0;p=sbcl.git diff --git a/src/compiler/ir1opt.lisp b/src/compiler/ir1opt.lisp index 640468e..d585c20 100644 --- a/src/compiler/ir1opt.lisp +++ b/src/compiler/ir1opt.lisp @@ -317,9 +317,15 @@ (let ((last (block-last block))) (typecase last (cif - (flush-dest (if-test last)) - (when (unlink-node last) - (return))) + (if (memq (continuation-type-check (if-test last)) + '(nil :deleted)) + ;; FIXME: Remove the test above when the bug 203 + ;; will be fixed. + (progn + (flush-dest (if-test last)) + (when (unlink-node last) + (return))) + (return))) (exit (when (maybe-delete-exit last) (return))))) @@ -514,10 +520,7 @@ :lossage-fun nil :unwinnage-fun nil)) (ir1-attributep attr unsafely-flushable))) - (flush-dest (combination-fun node)) - (dolist (arg (combination-args node)) - (flush-dest arg)) - (unlink-node node)))))) + (flush-combination node)))))) (mv-combination (when (eq (basic-combination-kind node) :local) (let ((fun (combination-lambda node))) @@ -633,22 +636,25 @@ (convert-if-if use node) (when (continuation-use test) (return))))) - (let* ((type (continuation-type test)) - (victim - (cond ((constant-continuation-p test) - (if (continuation-value test) - (if-alternative node) - (if-consequent node))) - ((not (types-equal-or-intersect type (specifier-type 'null))) - (if-alternative node)) - ((type= type (specifier-type 'null)) - (if-consequent node))))) - (when victim - (flush-dest test) - (when (rest (block-succ block)) - (unlink-blocks block victim)) - (setf (component-reanalyze (node-component node)) t) - (unlink-node node)))) + (when (memq (continuation-type-check test) + '(nil :deleted)) + ;; FIXME: Remove the test above when the bug 203 will be fixed. + (let* ((type (continuation-type test)) + (victim + (cond ((constant-continuation-p test) + (if (continuation-value test) + (if-alternative node) + (if-consequent node))) + ((not (types-equal-or-intersect type (specifier-type 'null))) + (if-alternative node)) + ((type= type (specifier-type 'null)) + (if-consequent node))))) + (when victim + (flush-dest test) + (when (rest (block-succ block)) + (unlink-blocks block victim)) + (setf (component-reanalyze (node-component node)) t) + (unlink-node node))))) (values)) ;;; Create a new copy of an IF node that tests the value of the node @@ -1263,7 +1269,8 @@ (setf (continuation-next cont) next) ;; FIXME: type checking? (reoptimize-continuation cont) - (reoptimize-continuation prev)))) + (reoptimize-continuation prev) + (flush-combination call)))) (t (let ((dummies (make-gensym-list (length args)))) (transform-call call @@ -1730,6 +1737,8 @@ (when (and (combination-p use) (eq (continuation-fun-name (combination-fun use)) 'list)) + + ;; FIXME: VALUES might not satisfy an assertion on NODE-CONT. (change-ref-leaf (continuation-use (combination-fun node)) (find-free-fun 'values "in a strange place")) (setf (combination-kind node) :full)