From 26839b3799e0687e8df96282aea0368ce12c1e95 Mon Sep 17 00:00:00 2001 From: Nikodemus Siivola Date: Mon, 12 Jan 2009 16:20:37 +0000 Subject: [PATCH] 1.0.24.40: fix regression from 1.0.24.37 * TNs with KIND :CONSTANT don't have leaves if they represent load time values. * Reported by Attila Lendvai. --- package-data-list.lisp-expr | 4 +++- src/compiler/tn.lisp | 10 ++++++++++ src/compiler/x86-64/pred.lisp | 4 ---- src/compiler/x86/pred.lisp | 4 ---- tests/compiler.pure.lisp | 5 +++++ version.lisp-expr | 2 +- 6 files changed, 19 insertions(+), 10 deletions(-) diff --git a/package-data-list.lisp-expr b/package-data-list.lisp-expr index 6dfe859..80e79f3 100644 --- a/package-data-list.lisp-expr +++ b/package-data-list.lisp-expr @@ -276,7 +276,9 @@ of SBCL which maintained the CMU-CL-style split into two packages.)" "GET-VECTOR-SUBTYPE" "GET-TOPLEVELISH-FILE-INFO" "HALT" - "IF-EQ" "INLINE-SYNTACTIC-CLOSURE-LAMBDA" + "IF-EQ" + "IMMEDIATE-TN-P" + "INLINE-SYNTACTIC-CLOSURE-LAMBDA" "INSERT-STEP-CONDITIONS" "IR2-COMPONENT-CONSTANTS" "IR2-CONVERT" "IR2-PHYSENV-NUMBER-STACK-P" diff --git a/src/compiler/tn.lisp b/src/compiler/tn.lisp index e109e49..38d1209 100644 --- a/src/compiler/tn.lisp +++ b/src/compiler/tn.lisp @@ -445,6 +445,16 @@ (aver (eq (tn-kind tn) :constant)) (constant-value (tn-leaf tn))) +(defun immediate-tn-p (tn) + (declare (type tn tn)) + (let ((leaf (tn-leaf tn))) + ;; Leaves with KIND :CONSTANT can have NIL as the leaf if they + ;; represent load time values. + (and leaf + (eq (tn-kind tn) :constant) + (eq (immediate-constant-sc (constant-value leaf)) + (sc-number-or-lose 'sb!vm::immediate))))) + ;;; Force TN to be allocated in a SC that doesn't need to be saved: an ;;; unbounded non-save-p SC. We don't actually make it a real "restricted" TN, ;;; but since we change the SC to an unbounded one, we should always succeed in diff --git a/src/compiler/x86-64/pred.lisp b/src/compiler/x86-64/pred.lisp index c74ed60..e1f08e0 100644 --- a/src/compiler/x86-64/pred.lisp +++ b/src/compiler/x86-64/pred.lisp @@ -103,10 +103,6 @@ (let ((scn (sc-number-or-lose representation))) (labels ((make-tn () (make-representation-tn ptype scn)) - (immediate-tn-p (tn) - (and (eq (sb!c::tn-kind tn) :constant) - (eq (sb!c::immediate-constant-sc (tn-value tn)) - (sc-number-or-lose 'immediate)))) (frob-tn (tn) (if (immediate-tn-p tn) tn diff --git a/src/compiler/x86/pred.lisp b/src/compiler/x86/pred.lisp index ce13f2b..73a6f8d 100644 --- a/src/compiler/x86/pred.lisp +++ b/src/compiler/x86/pred.lisp @@ -91,10 +91,6 @@ (let ((scn (sc-number-or-lose representation))) (labels ((make-tn () (make-representation-tn ptype scn)) - (immediate-tn-p (tn) - (and (eq (sb!c::tn-kind tn) :constant) - (eq (sb!c::immediate-constant-sc (tn-value tn)) - (sc-number-or-lose 'immediate)))) (frob-tn (tn) (if (immediate-tn-p tn) tn diff --git a/tests/compiler.pure.lisp b/tests/compiler.pure.lisp index 165c17b..e9f23d8 100644 --- a/tests/compiler.pure.lisp +++ b/tests/compiler.pure.lisp @@ -2691,6 +2691,11 @@ t) t))) +(with-test (:name :regression-1.0.24.37) + (compile nil '(lambda (&key (test (constantly t))) + (when (funcall test) + :quux)))) + ;;; Attempt to test a decent cross section of conditions ;;; and values types to move conditionally. (macrolet diff --git a/version.lisp-expr b/version.lisp-expr index 51ddad1..1ad7b35 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.24.39" +"1.0.24.40" -- 1.7.10.4