1.0.43.23: enable let-conversion for open-coded ALIEN-FUNCALL calls
authorNikodemus Siivola <nikodemus@random-state.net>
Mon, 4 Oct 2010 11:26:10 +0000 (11:26 +0000)
committerNikodemus Siivola <nikodemus@random-state.net>
Mon, 4 Oct 2010 11:26:10 +0000 (11:26 +0000)
 Otherwise DEBUG > SPEED prevents let-conversion, and leads to
 %SAP-ALIEN being left in the code.

 Fixes lp#654485.

NEWS
src/compiler/aliencomp.lisp
tests/alien.impure.lisp
version.lisp-expr

diff --git a/NEWS b/NEWS
index 29ddb9d..c8ee98e 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -25,6 +25,8 @@ changes relative to sbcl-1.0.43:
   * bug fix: compile-times no longer scale linearly with the size of
     quoted lists in source-code. (lp#654289)
   * bug fix: better errors for unknown external-formats in OPEN. (lp#561974)
+  * bug fix: DEBUG>SPEED no longer degrades ALIEN-FUNCALL performance quite
+    so badly. (lp#654485)
 
 changes in sbcl-1.0.43 relative to sbcl-1.0.42:
   * incompatible change: FD-STREAMS no longer participate in the serve-event
index 4321c31..5ca25ac 100644 (file)
               (setf body `(invoke-with-saved-fp-and-pc (lambda () ,body))))
             (/noshow "returning from DEFTRANSFORM ALIEN-FUNCALL" (params) body)
             `(lambda (function ,@(params))
+               (declare (optimize (let-conversion 3)))
                ,body)))))))
 
 (defoptimizer (%alien-funcall derive-type) ((function type &rest args))
index 096e82a..e68737c 100644 (file)
     (verify (signed 16)   #x003f8042 #x-7fbe)
     (verify (signed 16)   #x003f7042 #x7042)))
 
+(with-test (:name :bug-654485)
+  ;; DEBUG 2 used to prevent let-conversion of the open-coded ALIEN-FUNCALL body,
+  ;; which in turn led the dreaded %SAP-ALIEN note.
+  (handler-case
+      (compile nil
+               `(lambda (program argv)
+                  (declare (optimize (debug 2)))
+                  (with-alien ((sys-execv1 (function int c-string (* c-string)) :extern
+                                           "execv"))
+                    (values (alien-funcall sys-execv1 program argv)))))
+    (compiler-note (n)
+      (error n))))
+
 ;;; success
index f0865de..402cb56 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.43.22"
+"1.0.43.23"