0.9.4.83:
authorChristophe Rhodes <csr21@cam.ac.uk>
Wed, 21 Sep 2005 11:28:56 +0000 (11:28 +0000)
committerChristophe Rhodes <csr21@cam.ac.uk>
Wed, 21 Sep 2005 11:28:56 +0000 (11:28 +0000)
Pacify the compiler when inlining LAST1's code in a high-speed
low-space compilation environment.
... rebind the argument within last1 so that the assignments
are to that binding.

NEWS
src/code/list.lisp
tests/compiler.test.sh
version.lisp-expr

diff --git a/NEWS b/NEWS
index 72be4c3..4f2cf44 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -35,6 +35,9 @@ changes in sbcl-0.9.5 relative to sbcl-0.9.4:
     iterated. (reported by Bryan O'Connor, fixed by Rob MacLachlan)
   * bug fix: backquote does not optimize (LIST* x y) to CONS when x
     may be expanded. (reported by Alexander <malishev> on c.l.l)
+  * bug fix: no more style-warnings when compiling code using LAST
+    under high-SPEED low-SPACE settings.  (reported by David Wallin
+    aka froog on #lisp)
   * fixed some incompatibilities between SBCL's MOP and the MOP
     specified by AMOP:
     ** the METAOBJECT class is now implemented;
index 225f1bb..f15ad9f 100644 (file)
 (defun last1 (list)
   #!+sb-doc
   "Return the last cons (not the last element) of a list"
-  (let ((rest list))
+  (let ((rest list)
+        (list list))
     (loop (unless (consp rest) (return list))
           (shiftf list rest (cdr rest)))))
 
index 25c208c..6c135a4 100644 (file)
@@ -344,6 +344,14 @@ cat > $tmpfilename <<EOF
 EOF
 expect_failed_compile $tmpfilename
 
+cat > $tmpfilename <<EOF
+(declaim (optimize (speed 3) (space 0) (safety 0)))
+
+(defun foo (bar)
+  (last bar))
+EOF
+expect_clean_compile $tmpfilename
+
 rm $tmpfilename
 rm $compiled_tmpfilename
 
index 22b2ef3..ae1bd0f 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".)
-"0.9.4.82"
+"0.9.4.83"