From: Nathan Froyd Date: Thu, 30 Jun 2005 20:15:59 +0000 (+0000) Subject: 0.9.2.6: X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=e7428cc99bad5449e1f266b3ef5dfca675b72888;p=sbcl.git 0.9.2.6: Fix ASH to fold away shifts of zero based on the actual derived type, not just the constancy of the arg. --- diff --git a/src/compiler/srctran.lisp b/src/compiler/srctran.lisp index b4214fc..20ce740 100644 --- a/src/compiler/srctran.lisp +++ b/src/compiler/srctran.lisp @@ -3110,7 +3110,7 @@ ;;; Perhaps we should have to prove that the denominator is nonzero before ;;; doing them? -- WHN 19990917 (macrolet ((def (name) - `(deftransform ,name ((x y) ((constant-arg (integer 0 0)) integer) + `(deftransform ,name ((x y) ((integer 0 0) integer) *) "fold zero arg" 0))) @@ -3118,7 +3118,7 @@ (def /)) (macrolet ((def (name) - `(deftransform ,name ((x y) ((constant-arg (integer 0 0)) integer) + `(deftransform ,name ((x y) ((integer 0 0) integer) *) "fold zero arg" '(values 0 0)))) diff --git a/tests/compiler.pure.lisp b/tests/compiler.pure.lisp index 4325bd2..b85f5cf 100644 --- a/tests/compiler.pure.lisp +++ b/tests/compiler.pure.lisp @@ -1779,3 +1779,14 @@ (let ((x :good)) ((lambda (&optional (y x)) (declare (special x)) y))))))))) + +;;; Bug from pfdietz's random tester: the compiler knew that IMAGPART of +;;; a rational was zero, but didn't do the substitution, leading to a +;;; crash in the ASH vop (since a shift of 57 wouldn't fit in the +;;; machine's ASH instruction's immediate field) that the compiler +;;; thought was legitimate. +(compile 'nil + (LAMBDA (B) + (DECLARE (TYPE (INTEGER -2 14) B)) + (DECLARE (IGNORABLE B)) + (ASH (IMAGPART B) 57))) \ No newline at end of file diff --git a/version.lisp-expr b/version.lisp-expr index 4532060..f539110 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.9.2.5" +"0.9.2.6"