Skip to content
Snippets Groups Projects
Commit 746675f0 authored by ram's avatar ram
Browse files

Backed out of the last change and tried another cut. We maintain the

invariant that :LET lambdas always have a combination and bind node.
We fix the problem we were running into by being more careful about
deleting LETs when we see a combination, since the REF for the combination
might have already been deleted.  We might have been the 2n'd to last ref.
parent 2ad506ca
No related branches found
No related tags found
No related merge requests found
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
;;; Scott Fahlman or slisp-group@cs.cmu.edu. ;;; Scott Fahlman or slisp-group@cs.cmu.edu.
;;; ;;;
(ext:file-comment (ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/ir1util.lisp,v 1.53 1992/04/09 20:06:52 ram Exp $") "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/ir1util.lisp,v 1.54 1992/04/18 12:06:57 ram Exp $")
;;; ;;;
;;; ********************************************************************** ;;; **********************************************************************
;;; ;;;
...@@ -1046,12 +1046,32 @@ ...@@ -1046,12 +1046,32 @@
(do-nodes (node cont block) (do-nodes (node cont block)
(typecase node (typecase node
(ref (delete-ref node)) (ref (delete-ref node))
(cif
(flush-dest (if-test node)))
;;
;; The next two cases serve to maintain the invariant that a LET always
;; has a well-formed COMBINATION, REF and BIND. We delete the lambda
;; whenever we delete any of these, but we must be careful that this LET
;; has not already been partially deleted.
(basic-combination (basic-combination
(when (and (eq (basic-combination-kind node) :local)
;; Guards COMBINATION-LAMBDA agains the REF being deleted.
(continuation-use (basic-combination-fun node)))
(let ((fun (combination-lambda node)))
;; If our REF was the 2'nd to last ref, and has been deleted, then
;; Fun may be a LET for some other combination.
(when (and (member (functional-kind fun) '(:let :mv-let))
(eq (let-combination fun) node))
(delete-lambda fun))))
(flush-dest (basic-combination-fun node)) (flush-dest (basic-combination-fun node))
(dolist (arg (basic-combination-args node)) (dolist (arg (basic-combination-args node))
(when arg (flush-dest arg)))) (when arg (flush-dest arg))))
(cif (bind
(flush-dest (if-test node))) (let ((lambda (bind-lambda node)))
(unless (eq (functional-kind lambda) :deleted)
(assert (member (functional-kind lambda)
'(:let :mv-let :assignment)))
(delete-lambda lambda))))
(exit (exit
(let ((value (exit-value node)) (let ((value (exit-value node))
(entry (exit-entry node))) (entry (exit-entry node)))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment