diff --git a/src/compiler/copyprop.lisp b/src/compiler/copyprop.lisp index c38e83ef9..7c15692c7 100644 --- a/src/compiler/copyprop.lisp +++ b/src/compiler/copyprop.lisp @@ -100,8 +100,8 @@ ;; TN for debugging? (or (not (cl:symbol-package (leaf-debug-name leaf))) - (policy (vop-node vop) - (= preserve-single-use-debug-variables 0))) + (loop for ref in (leaf-refs leaf) + never (preserve-single-use-debug-var-p ref leaf))) ;; arguments of local functions have hidden write (not (and (lambda-var-p leaf) (memq (functional-kind (lambda-var-home leaf)) diff --git a/src/compiler/generic/pinned-objects.lisp b/src/compiler/generic/pinned-objects.lisp index 0587c07fa..5458ac541 100644 --- a/src/compiler/generic/pinned-objects.lisp +++ b/src/compiler/generic/pinned-objects.lisp @@ -34,7 +34,9 @@ garbage collection." ;; The cross-compiler prints either "unknown type: COMPILER-NOTE" at ;; each use of W-P-O prior to 'ir1report' being compiled, or else ;; "could not stack allocate". Kill it with fire :-( - (declare (muffle-conditions #+sb-xc compiler-note #-sb-xc t)) + (declare (muffle-conditions #+sb-xc compiler-note #-sb-xc t) + (optimize sb-c::preserve-constants + sb-c::preserve-single-use-debug-variables)) ;; PINS are dx-allocated in case the compiler for some ;; unfathomable reason decides to allocate value-cells ;; for them -- since we have DX value-cells on x86oid diff --git a/src/compiler/ir1opt.lisp b/src/compiler/ir1opt.lisp index 1a980182c..20f34b256 100644 --- a/src/compiler/ir1opt.lisp +++ b/src/compiler/ir1opt.lisp @@ -2243,6 +2243,8 @@ ((lambda-var-deleted var)) ((lambda-var-sets var) (propagate-from-sets var type)) + ((loop for ref in (leaf-refs var) + thereis (preserve-single-use-debug-var-p ref var))) ((and arg (let ((use (lvar-uses arg))) (when (ref-p use)