0.8.21.17:
authorChristophe Rhodes <csr21@cam.ac.uk>
Tue, 5 Apr 2005 11:03:19 +0000 (11:03 +0000)
committerChristophe Rhodes <csr21@cam.ac.uk>
Tue, 5 Apr 2005 11:03:19 +0000 (11:03 +0000)
Fix fixnum / sb!xc:fixnum xc bug (as in discussion with Bruno Haible
sbcl-devel 2005-03/2005-04)
... don't use the CL:FIXNUM type in immediate-constant-sc;
... write and use a test in before-xc.

NEWS
make-host-1.sh
src/compiler/alpha/vm.lisp
src/compiler/hppa/vm.lisp
src/compiler/mips/vm.lisp
src/compiler/ppc/vm.lisp
src/compiler/sparc/vm.lisp
tests/vm.before-xc.lisp [new file with mode: 0644]
version.lisp-expr

diff --git a/NEWS b/NEWS
index b39bf9a..fec42bf 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -14,6 +14,8 @@ changes in sbcl-0.8.22 relative to sbcl-0.8.21:
   * fixed bug 376: CONJUGATE type deriver.
   * fixed infinite looping of ALIEN-FUNCALL, compiled with high DEBUG.
     (reported by Baughn on #lisp)
+  * a cross-compiler bug on non-x86 platforms has been identified and
+    fixed.  (thanks to Bruno Haible)
   * fixed some bugs related to Unicode integration:
     ** the restarts for recovering from input and output encoding
        errors only appear when there is in fact such an error to
index 6800367..6093419 100644 (file)
@@ -42,7 +42,8 @@ $SBCL_XC_HOST <<-'EOF' || exit 1
        ;; to debug cross-compilation if it isn't.)
        (when (find :sb-test *shebang-features*)
          (load "tests/type.before-xc.lisp")
-         (load "tests/info.before-xc.lisp"))
+         (load "tests/info.before-xc.lisp")
+         (load "tests/vm.before-xc.lisp"))
         (load "tools-for-build/ucd.lisp")
         (sb-cold::slurp-ucd)
         (sb-cold::output)
index 7cd45fc..43e8987 100644 (file)
      (sc-number-or-lose 'zero))
     (null
      (sc-number-or-lose 'null ))
-    ((or fixnum system-area-pointer character)
+    ((or (integer sb!xc:most-negative-fixnum sb!xc:most-positive-fixnum)
+        system-area-pointer character)
      (sc-number-or-lose 'immediate ))
     (symbol
      (if (static-symbol-p value)
index e80187c..46a2882 100644 (file)
      (sc-number-or-lose 'zero))
     (null
      (sc-number-or-lose 'null))
-    ((or fixnum system-area-pointer character)
+    ((or (integer #.sb!xc:most-negative-fixnum #.sb!xc:most-positive-fixnum)
+        system-area-pointer character)
      (sc-number-or-lose 'immediate))
     (symbol
      (if (static-symbol-p value)
index 6d37198..78448a3 100644 (file)
      (if (static-symbol-p value)
         (sc-number-or-lose 'immediate)
         nil))
-    ((signed-byte 30)
+    ((integer #.sb!xc:most-negative-fixnum sb!xc:most-positive-fixnum)
      (sc-number-or-lose 'immediate))
     (system-area-pointer
      (sc-number-or-lose 'immediate))
index dbc2fa3..c52ddfe 100644 (file)
      (sc-number-or-lose 'zero))
     (null
      (sc-number-or-lose 'null))
-    ((or fixnum system-area-pointer character)
+    ((or (integer #.sb!xc:most-negative-fixnum #.sb!xc:most-positive-fixnum)
+        system-area-pointer character)
      (sc-number-or-lose 'immediate))
     (symbol
      (if (static-symbol-p value)
index a315d90..2a93b22 100644 (file)
      (sc-number-or-lose 'zero))
     (null
      (sc-number-or-lose 'null))
-    ((or fixnum system-area-pointer character)
+    ((or (integer #.sb!xc:most-negative-fixnum #.sb!xc:most-positive-fixnum)
+        system-area-pointer character)
      (sc-number-or-lose 'immediate))
     (symbol
      (if (static-symbol-p value)
diff --git a/tests/vm.before-xc.lisp b/tests/vm.before-xc.lisp
new file mode 100644 (file)
index 0000000..4fa4841
--- /dev/null
@@ -0,0 +1,33 @@
+;;;; tests of the compiler vm internal consistency intended to be
+;;;; executed as soon as the cross-compiler is built.
+
+;;;; This software is part of the SBCL system. See the README file for
+;;;; more information.
+;;;;
+;;;; While most of SBCL is derived from the CMU CL system, the test
+;;;; files (like this one) were written from scratch after the fork
+;;;; from CMU CL.
+;;;; 
+;;;; This software is in the public domain and is provided with
+;;;; absolutely no warranty. See the COPYING and CREDITS files for
+;;;; more information.
+
+(in-package "SB!VM")
+
+(/show "beginning tests/vm.before-xc.lisp")
+
+(flet ((yes (x)
+        (assert
+         (eql (sc-number-or-lose 'immediate)
+              (impl-of-vm-support-routine-immediate-constant-sc x))))
+       (no (x)
+        (assert
+         (not (impl-of-vm-support-routine-immediate-constant-sc x)))))
+  ;; target fixnums can be dealt with as immediates; target bignums
+  ;; can not.
+  (yes #.sb-xc:most-positive-fixnum)
+  (yes #.sb-xc:most-negative-fixnum)
+  (no #.(1+ sb-xc:most-positive-fixnum))
+  (no #.(1- sb-xc:most-negative-fixnum)))
+
+(/show "done with tests/vm.before-xc.lisp")
index 3188f64..ac2a572 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.8.21.16"
+"0.8.21.17"