From: Richard M Kreuter Date: Thu, 11 Sep 2008 21:55:51 +0000 (+0000) Subject: 1.0.20.5: Fix stupid bugs introduced in 1.0.20.4. X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=519b843c9d1af8138a5ec15516702249a71ffa92;p=sbcl.git 1.0.20.5: Fix stupid bugs introduced in 1.0.20.4. * Dumb mistakes that weren't caught on x86-64 for some reason. Tested this on Linux/x86, Linux/pcc, NetBSD/x86. --- diff --git a/src/compiler/constraint.lisp b/src/compiler/constraint.lisp index 3d7bd35..1052d8c 100644 --- a/src/compiler/constraint.lisp +++ b/src/compiler/constraint.lisp @@ -149,16 +149,9 @@ :type simple-bit-vector) ;; Bit-vectors win over lightweight hashes for copy, union, ;; intersection, difference, but lose for iteration if you iterate - ;; over the whole vector. Under some measurements in 2008, it - ;; turned out that constraint sets elements were normally clumped - ;; together: for compiling SBCL, the average difference between - ;; the maximum and minimum constraint-number was 90 (with the - ;; average constraint set having around 25 elements). So using - ;; the minimum and maximum constraint-number for iteration bounds - ;; makes iteration over a subrange of the bit-vector comparable to - ;; iteration across the hash storage. Note that the CONSET-MIN is - ;; NIL when the set is known to be empty. CONSET-MAX is a normal - ;; end bounding index. + ;; over the whole vector. Tracking extrema helps a bit. Note + ;; that the CONSET-MIN is NIL when the set is known to be empty. + ;; CONSET-MAX is a normal end bounding index. (min nil :type (or fixnum null)) (max 0 :type fixnum)) @@ -288,12 +281,14 @@ (or (conset-min conset-2) most-positive-fixnum))) ((conset-intersection) - `(position 1 (conset-vector conset-1) - :start - (max (or (conset-min conset-1) 0) - (or (conset-min conset-2) 0)) - :end (min (conset-max conset-1) - (conset-max conset-1)))) + `(let ((start (max (or (conset-min conset-1) 0) + (or (conset-min conset-2) 0))) + (end (min (conset-max conset-1) + (conset-max conset-1)))) + (if (> start end) + nil + (position 1 (conset-vector conset-1) + :start start :end end)))) ((conset-difference) `(position 1 (conset-vector conset-1) :start (or (conset-min conset-1) 0) @@ -305,29 +300,29 @@ `(max (conset-max conset-1) (conset-max conset-2))) ((conset-intersection) - `(let ((position - (position - 1 (conset-vector conset-1) - :start (let ((max - (min (conset-max conset-1) - (conset-max conset-2)))) - (if (plusp max) - (1- max) - 0)) - :end (conset-min conset-1) - :from-end t))) - (if position - (1+ position) - 0))) + `(let ((start (max (or (conset-min conset-1) 0) + (or (conset-min conset-2) 0))) + (end (let ((minimum-maximum + (min (conset-max conset-1) + (conset-max conset-2)))) + (if (plusp minimum-maximum) + (1- minimum-maximum) + 0)))) + (if (> start end) + 0 + (let ((position + (position + 1 (conset-vector conset-1) + :start start :end end :from-end t))) + (if position + (1+ position) + 0))))) ((conset-difference) `(let ((position (position 1 (conset-vector conset-1) - :start (let ((max (conset-max conset-1))) - (if (plusp max) - (1- max) - 0)) - :end (or (conset-min conset-1) 0) + :start (or (conset-min conset-1) 0) + :end (conset-max conset-1) :from-end t))) (if position (1+ position) diff --git a/version.lisp-expr b/version.lisp-expr index dde852d..422c46f 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.20.4" +"1.0.20.5"