0.7.6.26:
authorWilliam Harold Newman <william.newman@airmail.net>
Sun, 18 Aug 2002 13:55:26 +0000 (13:55 +0000)
committerWilliam Harold Newman <william.newman@airmail.net>
Sun, 18 Aug 2002 13:55:26 +0000 (13:55 +0000)
comment tweaking
fixed bug 192, "constant-folding DATA-VECTOR-REF", by adding an
ordinary DEFUN definition of D-V-R

BUGS
NEWS
make.sh
src/code/array.lisp
src/cold/snapshot.lisp
src/pcl/fngen.lisp
tests/compiler.impure.lisp
version.lisp-expr

diff --git a/BUGS b/BUGS
index 1749fca..48a6a4b 100644 (file)
--- a/BUGS
+++ b/BUGS
@@ -1441,44 +1441,6 @@ WORKAROUND:
   c. the examples in CLHS 7.6.5.1 (regarding generic function lambda
      lists and &KEY arguments) do not signal errors when they should.
 
-192: "constant-folding DATA-VECTOR-REF"
-  (from Einar Floystad Dorum sbcl-devel 14 Aug 2002)
-  Typing this 
-    (defun test ()
-      (funcall 
-       (LAMBDA (TEXT I L )
-         (LABELS ((G908 (I)
-                    (LET ((INDEX
-                           (OR
-                            (IF (= I L)
-                                NIL
-                                (LET ((S TEXT)
-                                      (E (ELT TEXT I)))
-                                  (DECLARE (IGNORABLE S E))
-                                  (WHEN (EQL #\a E)
-                                    (G909 (1+ I))))))))
-                      INDEX))
-                  (G909 (I)
-                    (OR
-                     (IF (= I L)
-                         NIL
-                         (LET ((S TEXT)
-                               (E (ELT TEXT I)))
-                           (DECLARE (IGNORABLE S E))
-                           (WHEN (EQL #\b E) (G910 (1+ I)))))))
-                  (G910 (I)
-                    (LET ((INDEX
-                           (OR
-                            (IF NIL
-                                NIL
-                                (LET ((S TEXT))
-                                  (DECLARE (IGNORABLE S))
-                                  (WHEN T I))))))
-                      INDEX)))
-           (G908 I))) "abcdefg" 0 (length "abcdefg")))
-  at the command prompt in sbcl-0.7.6.23 gives 
-  (BUG "full call to SB-KERNEL:DATA-VECTOR-REF").
-
 DEFUNCT CATEGORIES OF BUGS
   IR1-#:
     These labels were used for bugs related to the old IR1 interpreter.
diff --git a/NEWS b/NEWS
index c517832..d9d5817 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1226,7 +1226,10 @@ changes in sbcl-0.7.7 relative to sbcl-0.7.6:
   * Bug fix: changed encoding of PCL's internal MAKE-INSTANCE
     functions so that EXPORTing the name of the class doesn't cause
     MAKE-INSTANCE functions from earlier DEFCLASSes to get lost (thanks
-    to Antonio Martinez)
+    to Antonio Martinez for reporting this)
+  * Bug 192 fixed: The internal primitive DATA-VECTOR-REF can now be
+    constant-folded without failing an assertion. (thanks to Einar
+    Floystad Dorum for reporting this)
   * Minor incompatible change: COMPILE-FILE-PATHNAME now merges its
     OUTPUT-FILE argument with its INPUT-FILE argument, resulting in
     behaviour analogous to RENAME-FILE.  This puts its behaviour more
diff --git a/make.sh b/make.sh
index 14dd17c..6aa8f99 100755 (executable)
--- a/make.sh
+++ b/make.sh
 #   "lisp -noinit -batch" 
 #                 to use an existing CMU CL binary as a cross-compilation host
 #                 when you have weird things in your .cmucl-init file
-# Someday any sufficiently ANSI Common Lisp, perhaps CLISP and/or
-# OpenMCL should work
-#   "clisp"
-#   "??"
-# but not yet as of sbcl-0.7.4. (There are still some weird dependencies
-# on idiosyncrasies of the way CMU CL implements Common Lisp.)
+#   "openmcl --batch"
+#                 to use an OpenMCL binary as a cross-compilation host
 #
 # FIXME: Make a more sophisticated command line parser, probably
 # accepting "sh make.sh --xc-host foolisp" instead of the
index 360514d..f4791de 100644 (file)
                                                index))))
                         *specialized-array-element-types*))))
 
+;;; (Ordinary DATA-VECTOR-REF usage compiles into a vop, but
+;;; DATA-VECTOR-REF is also FOLDABLE, and this ordinary function
+;;; definition is needed for the compiler to use in constant folding.)
+(defun data-vector-ref (array index)
+  (hairy-data-vector-ref array index))
+
 (defun hairy-data-vector-set (array index new-value)
   (with-array-data ((vector array) (index index) (end))
     (declare (ignore end))
index 846c06f..a52d1ca 100644 (file)
@@ -1,4 +1,23 @@
 ;;;; code to detect whether a package has changed
+;;;;
+;;;; This is really old code which was most useful when first
+;;;; bootstrapping SBCL when only CMU CL was available as an XC host.
+;;;; Its main purpose was to check that legacy code like DEFMACRO
+;;;; DOLIST and DEFUN IR1-OPTIMIZE-UNTIL-DONE was all correctly
+;;;; converted from code which mutated the XC host into code which
+;;;; built things for the target.
+;;;;
+;;;; These days, things like DEFUN IR1-OPTIMIZE-UNTIL-DONE can't very
+;;;; well be mutating the cross-compiler host because we can build
+;;;; successfully under OpenMCL, which shouldn't have the same
+;;;; packages or symbols. So we don't need to worry very much about
+;;;; modifying the XC host's private packages. However, it's still
+;;;; conceivable that something affecting the XC host's CL package
+;;;; (maybe DEFMACRO DOLIST?) could be written in such a way that it
+;;;; would silently compile under SBCL, CMU CL, and even OpenMCL, and
+;;;; still be fundamentally wrong. Since it'd be good to prevent such
+;;;; modifications of the XC host's CL package, this code is still
+;;;; retained despite being a little strange.
 
 ;;;; This software is part of the SBCL system. See the README file for
 ;;;; more information.
index 7564c76..5a1222a 100644 (file)
 
 (defun load-function-generator (test gensyms generator generator-lambda system)
   (store-fgen (make-fgen test gensyms generator generator-lambda system)))
-
index 7806b50..af77b04 100644 (file)
    (logand a0 a10)
    ;; a call to prevent the other arguments from being optimized away
    (logand a1 a2 a3 a4 a5 a6 a7 a8 a9)))
+
+;;; bug 192, reported by Einar Floystad Dorum: Compiling this in 0.7.6
+;;; caused the compiler to try to constant-fold DATA-VECTOR-REF, which
+;;; is OK, except that there was no non-VOP definition of
+;;; DATA-VECTOR-REF, so it would fail.
+(defun bug192 ()
+      (funcall 
+       (LAMBDA (TEXT I L )
+         (LABELS ((G908 (I)
+                    (LET ((INDEX
+                           (OR
+                            (IF (= I L)
+                                NIL
+                                (LET ((S TEXT)
+                                      (E (ELT TEXT I)))
+                                  (DECLARE (IGNORABLE S E))
+                                  (WHEN (EQL #\a E)
+                                    (G909 (1+ I))))))))
+                      INDEX))
+                  (G909 (I)
+                    (OR
+                     (IF (= I L)
+                         NIL
+                         (LET ((S TEXT)
+                               (E (ELT TEXT I)))
+                           (DECLARE (IGNORABLE S E))
+                           (WHEN (EQL #\b E) (G910 (1+ I)))))))
+                  (G910 (I)
+                    (LET ((INDEX
+                           (OR
+                            (IF NIL
+                                NIL
+                                (LET ((S TEXT))
+                                  (DECLARE (IGNORABLE S))
+                                  (WHEN T I))))))
+                      INDEX)))
+           (G908 I))) "abcdefg" 0 (length "abcdefg")))
 \f
 ;;; BUG 48a. and b. (symbol-macrolet handling), fixed by Eric Marsden
 ;;; and Raymond Toy for CMUCL, fix ported for sbcl-0.7.6.18.
index 6bbbd47..99b7acd 100644 (file)
@@ -18,4 +18,4 @@
 ;;; for internal versions, especially for internal versions off the
 ;;; main CVS branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
 
-"0.7.6.25"
+"0.7.6.26"