From d4624e03c64b15a86594b12020da88d7e5167e4f Mon Sep 17 00:00:00 2001 From: Nikodemus Siivola Date: Fri, 20 Jul 2007 23:43:21 +0000 Subject: [PATCH] 1.0.7.34: adjust lexenv frobbing in TRANSFORM-CALL to happen earlier * Need to replace the call lexenv with the frobbed one before WITH-IR1-ENVIRONMENT-FROM-NODE so that IR1-CONVERT-INLINE-LAMBDA gets a consistent *LEXENV* binding. (This has been around since 0.9.17.5, but since it only affects known functions with optional arguments and transformations it suddenly become a lot more easy to hit with the new MEMBER and ASSOC transforms.) * Test case. --- src/compiler/ir1opt.lisp | 26 +++++++++++++++----------- tests/compiler.pure.lisp | 11 +++++++++++ version.lisp-expr | 2 +- 3 files changed, 27 insertions(+), 12 deletions(-) diff --git a/src/compiler/ir1opt.lisp b/src/compiler/ir1opt.lisp index 6da6828f7..78ae5a8d2 100644 --- a/src/compiler/ir1opt.lisp +++ b/src/compiler/ir1opt.lisp @@ -1125,9 +1125,24 @@ (aver (and (legal-fun-name-p source-name) (not (eql source-name '.anonymous.)))) (node-ends-block call) + ;; The internal variables of a transform are not going to be + ;; interesting to the debugger, so there's no sense in + ;; suppressing the substitution of variables with only one use + ;; (the extra variables can slow down constraint propagation). + ;; + ;; This needs to be done before the WITH-IR1-ENVIRONMENT-FROM-NODE, + ;; so that it will bind *LEXENV* to the right environment. + (setf (combination-lexenv call) + (make-lexenv :default (combination-lexenv call) + :policy (process-optimize-decl + '(optimize + (preserve-single-use-debug-variables 0)) + (lexenv-policy + (combination-lexenv call))))) (with-ir1-environment-from-node call (with-component-last-block (*current-component* (block-next (node-block call))) + (let ((new-fun (ir1-convert-inline-lambda res :debug-name (debug-name 'lambda-inlined source-name) @@ -1135,17 +1150,6 @@ (ref (lvar-use (combination-fun call)))) (change-ref-leaf ref new-fun) (setf (combination-kind call) :full) - ;; The internal variables of a transform are not going to be - ;; interesting to the debugger, so there's no sense in - ;; suppressing the substitution of variables with only one use - ;; (the extra variables can slow down constraint propagation). - (setf (combination-lexenv call) - (make-lexenv :default (combination-lexenv call) - :policy (process-optimize-decl - '(optimize - (preserve-single-use-debug-variables 0)) - (lexenv-policy - (combination-lexenv call))))) (locall-analyze-component *current-component*)))) (values)) diff --git a/tests/compiler.pure.lisp b/tests/compiler.pure.lisp index cd96971eb..d4608173a 100644 --- a/tests/compiler.pure.lisp +++ b/tests/compiler.pure.lisp @@ -2276,3 +2276,14 @@ (funcall fun '((foo (bar))))))))) (funcall fun))) + +(with-test (:name :high-debug-known-function-transform-with-optional-arguments) + (compile nil '(lambda (x y) + (declare (optimize sb-c::preserve-single-use-debug-variables)) + (if (block nil + (some-unknown-function + (lambda () + (return (member x y)))) + t) + t + (error "~a" y))))) diff --git a/version.lisp-expr b/version.lisp-expr index 880cba66e..f331a94da 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -17,4 +17,4 @@ ;;; checkins which aren't released. (And occasionally for internal ;;; versions, especially for internal versions off the main CVS ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".) -"1.0.7.33" +"1.0.7.34" -- 2.11.4.GIT