Incorrect value in integer expression in 1.1.9
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
Fix Released
|
Medium
|
Unassigned |
Bug Description
(defun test-2013-0709-1 ()
(let ((a 530436387)
(c -4890629672277))
(list (f1 a c) (f2 a c))))
(defun f1 (a c)
(declare (type (integer -2 1217810089) a))
(declare (type (integer -6895591104928 -561736648588) c))
(declare (optimize (speed 2) (space 0) (safety 2) (debug 0)
(logandc1 (gcd c)
(+ (- a c)
(loop for lv2 below 1 count t)
)))
(defun f2 (a c)
(declare (notinline - + gcd logandc1))
(declare (optimize (speed 1) (space 1) (safety 0) (debug 1)
(logandc1 (gcd c)
(+ (- a c)
(loop for lv2 below 1 count t))))
;; In SBCL 1.1.9 (x86-64 Linux):
;;
;; (test-2013-0709-1) ==> (92233720381927
;;
;; (the first value is incorrect)
;;
;; This was found by the usual random testing.
Changed in sbcl: | |
status: | Fix Committed → Fix Released |
;; Perhaps related:
(defun test-2013-0709-2 ()
(let ((a -1491588365)
(b -3745511761))
(list (g1 a b) (g2 a b))))
(defun g1 (a b)
(compilation- speed 2)))
(declare (type (integer -1869232508 -6939151) a))
(declare (type (integer -11466348357 -2645644006) b))
(declare (optimize (speed 1) (space 0) (safety 2) (debug 2)
(logand (lognand a -6) (* b -502823994)))
(defun g2 (a b)
(logand (lognand a -6) (* b -502823994)))
;; In SBCL 1.1.9 (x86 64 Linux), 05800 1084329992)
;;
;; (test-2013-0709-2) ==> (92233720379391