1.0.7.34: adjust lexenv frobbing in TRANSFORM-CALL to happen earlier
authorNikodemus Siivola <nikodemus@random-state.net>
Fri, 20 Jul 2007 23:43:21 +0000 (23:43 +0000)
committerNikodemus Siivola <nikodemus@random-state.net>
Fri, 20 Jul 2007 23:43:21 +0000 (23:43 +0000)
 * 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
tests/compiler.pure.lisp
version.lisp-expr

index 6da6828..78ae5a8 100644 (file)
   (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)
             (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))
 
index cd96971..d460817 100644 (file)
                           (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)))))
index 880cba6..f331a94 100644 (file)
@@ -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"