From: Nikodemus Siivola Date: Mon, 4 Oct 2010 11:26:10 +0000 (+0000) Subject: 1.0.43.23: enable let-conversion for open-coded ALIEN-FUNCALL calls X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=8f51ee96ea809abd464552f4322a3bba7766ad8e;p=sbcl.git 1.0.43.23: enable let-conversion for open-coded ALIEN-FUNCALL calls Otherwise DEBUG > SPEED prevents let-conversion, and leads to %SAP-ALIEN being left in the code. Fixes lp#654485. --- diff --git a/NEWS b/NEWS index 29ddb9d..c8ee98e 100644 --- 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 diff --git a/src/compiler/aliencomp.lisp b/src/compiler/aliencomp.lisp index 4321c31..5ca25ac 100644 --- a/src/compiler/aliencomp.lisp +++ b/src/compiler/aliencomp.lisp @@ -706,6 +706,7 @@ (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)) diff --git a/tests/alien.impure.lisp b/tests/alien.impure.lisp index 096e82a..e68737c 100644 --- a/tests/alien.impure.lisp +++ b/tests/alien.impure.lisp @@ -294,4 +294,17 @@ (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 diff --git a/version.lisp-expr b/version.lisp-expr index f0865de..402cb56 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.43.22" +"1.0.43.23"