1.0.20.5: Fix stupid bugs introduced in 1.0.20.4.
authorRichard M Kreuter <kreuter@users.sourceforge.net>
Thu, 11 Sep 2008 21:55:51 +0000 (21:55 +0000)
committerRichard M Kreuter <kreuter@users.sourceforge.net>
Thu, 11 Sep 2008 21:55:51 +0000 (21:55 +0000)
* Dumb mistakes that weren't caught on x86-64 for some reason.  Tested
  this on Linux/x86, Linux/pcc, NetBSD/x86.

src/compiler/constraint.lisp
version.lisp-expr

index 3d7bd35..1052d8c 100644 (file)
             :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))
 
                                 (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)
                           `(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)
index dde852d..422c46f 100644 (file)
@@ -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"