Commit c1f08ed2 authored by ram's avatar ram
Browse files

Add DELETE-IF-NO-ENTRIES to blow away components that can't be reached before

we try to generate IR2.  This avoids some internal errors when unreachable
local functions are deleted.
parent e77e132f
......@@ -7,7 +7,7 @@
;;; Scott Fahlman or
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/main.lisp,v 1.100 1994/01/05 16:33:44 ram Exp $")
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/main.lisp,v 1.101 1994/02/10 23:20:53 ram Exp $")
;;; **********************************************************************
......@@ -359,6 +359,26 @@
(and *byte-compile* *byte-compiling*)))
;;; DELETE-IF-NO-ENTRIES -- Internal
;;; Delete components with no external entry points before we try to
;;; generate code. Unreachable closures can cause IR2 conversion to puke on
;;; itself, since it is the reference to the closure which normally causes the
;;; components to be combined. This doesn't really cover all cases...
(defun delete-if-no-entries (component)
(dolist (fun (component-lambdas component)
(delete-component component))
(case (functional-kind fun)
(:top-level (return))
(unless (every #'(lambda (ref)
(eq (block-component (node-block ref))
(leaf-refs fun))
;;; COMPILE-COMPONENT -- internal.
(defun compile-component (component)
......@@ -391,6 +411,8 @@
(environment-analyze component)
(dfo-as-needed component)
(delete-if-no-entries component)
(unless (eq (block-next (component-head component))
(component-tail component))
(if *byte-compiling*
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment