(reported by Rick Taube)
* bug fix: structures defined by WITH-ALIEN can be referred to
within other definitions in the same WITH-ALIEN.
+ * bug fix: division operators (MOD, TRUNCATE and the like) with
+ constant zero divisors and integer dividends no longer generate
+ left shifts.
changes in sbcl-0.8.13 relative to sbcl-0.8.12:
* new feature: SB-PACKAGE-LOCKS. See the "Package Locks" section of
(give-up-ir1-transform))
(let* ((denominator (lvar-value denominator))
(bits (1- (integer-length denominator))))
- (unless (= (ash 1 bits) denominator)
+ (unless (and (> denominator 0) (= (ash 1 bits) denominator))
(give-up-ir1-transform))
(let ((alignment (count-low-order-zeros numerator)))
(unless (>= alignment bits)
(let* ((y (lvar-value y))
(y-abs (abs y))
(len (1- (integer-length y-abs))))
- (unless (= y-abs (ash 1 len))
+ (unless (and (> y-abs 0) (= y-abs (ash 1 len)))
(give-up-ir1-transform))
(if (minusp y)
`(- (ash x ,len))
(let* ((y (lvar-value y))
(y-abs (abs y))
(len (1- (integer-length y-abs))))
- (unless (= y-abs (ash 1 len))
+ (unless (and (> y-abs 0) (= y-abs (ash 1 len)))
(give-up-ir1-transform))
(let ((shift (- len))
(mask (1- y-abs))
(let* ((y (lvar-value y))
(y-abs (abs y))
(len (1- (integer-length y-abs))))
- (unless (= y-abs (ash 1 len))
+ (unless (and (> y-abs 0) (= y-abs (ash 1 len)))
(give-up-ir1-transform))
(let ((mask (1- y-abs)))
(if (minusp y)
(let* ((y (lvar-value y))
(y-abs (abs y))
(len (1- (integer-length y-abs))))
- (unless (= y-abs (ash 1 len))
+ (unless (and (> y-abs 0) (= y-abs (ash 1 len)))
(give-up-ir1-transform))
(let* ((shift (- len))
(mask (1- y-abs)))
(let* ((y (lvar-value y))
(y-abs (abs y))
(len (1- (integer-length y-abs))))
- (unless (= y-abs (ash 1 len))
+ (unless (and (> y-abs 0) (= y-abs (ash 1 len)))
(give-up-ir1-transform))
(let ((mask (1- y-abs)))
`(if (minusp x)
;;; ASH of a negative bignum by a bignum count would erroneously
;;; return 0 prior to sbcl-0.8.4.4
(assert (= (ash (1- most-negative-fixnum) (1- most-negative-fixnum)) -1))
+
+;;; Whoops. Too much optimization in division operators for 0
+;;; divisor.
+(macrolet ((frob (name)
+ `(let ((fn (compile nil '(lambda (x)
+ (declare (optimize speed) (fixnum x))
+ (,name x 0)))))
+ (assert (raises-error? (funcall fn 1) division-by-zero)))))
+ (frob mod)
+ (frob truncate)
+ (frob rem)
+ (frob /)
+ (frob floor)
+ (frob ceiling))
;;; 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.13.11"
+"0.8.13.12"