From 8a8568603cc7cacd188fe1cac18824a69bece6af Mon Sep 17 00:00:00 2001 From: Christophe Rhodes Date: Tue, 5 Apr 2005 11:03:19 +0000 Subject: [PATCH] 0.8.21.17: 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 | 2 ++ make-host-1.sh | 3 ++- src/compiler/alpha/vm.lisp | 3 ++- src/compiler/hppa/vm.lisp | 3 ++- src/compiler/mips/vm.lisp | 2 +- src/compiler/ppc/vm.lisp | 3 ++- src/compiler/sparc/vm.lisp | 3 ++- tests/vm.before-xc.lisp | 33 +++++++++++++++++++++++++++++++++ version.lisp-expr | 2 +- 9 files changed, 47 insertions(+), 7 deletions(-) create mode 100644 tests/vm.before-xc.lisp diff --git a/NEWS b/NEWS index b39bf9a..fec42bf 100644 --- 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 diff --git a/make-host-1.sh b/make-host-1.sh index 6800367..6093419 100644 --- a/make-host-1.sh +++ b/make-host-1.sh @@ -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) diff --git a/src/compiler/alpha/vm.lisp b/src/compiler/alpha/vm.lisp index 7cd45fc..43e8987 100644 --- a/src/compiler/alpha/vm.lisp +++ b/src/compiler/alpha/vm.lisp @@ -286,7 +286,8 @@ (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/src/compiler/hppa/vm.lisp b/src/compiler/hppa/vm.lisp index e80187c..46a2882 100644 --- a/src/compiler/hppa/vm.lisp +++ b/src/compiler/hppa/vm.lisp @@ -277,7 +277,8 @@ (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/src/compiler/mips/vm.lisp b/src/compiler/mips/vm.lisp index 6d37198..78448a3 100644 --- a/src/compiler/mips/vm.lisp +++ b/src/compiler/mips/vm.lisp @@ -286,7 +286,7 @@ (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)) diff --git a/src/compiler/ppc/vm.lisp b/src/compiler/ppc/vm.lisp index dbc2fa3..c52ddfe 100644 --- a/src/compiler/ppc/vm.lisp +++ b/src/compiler/ppc/vm.lisp @@ -272,7 +272,8 @@ (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/src/compiler/sparc/vm.lisp b/src/compiler/sparc/vm.lisp index a315d90..2a93b22 100644 --- a/src/compiler/sparc/vm.lisp +++ b/src/compiler/sparc/vm.lisp @@ -311,7 +311,8 @@ (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 index 0000000..4fa4841 --- /dev/null +++ b/tests/vm.before-xc.lisp @@ -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") diff --git a/version.lisp-expr b/version.lisp-expr index 3188f64..ac2a572 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".) -"0.8.21.16" +"0.8.21.17" -- 1.7.10.4