[armedbear-cvs] r11963 - branches/0.15.x/abcl/src/org/armedbear/lisp

Erik Huelsmann ehuelsmann at common-lisp.net
Fri May 29 06:15:01 UTC 2009


Author: ehuelsmann
Date: Fri May 29 02:14:57 2009
New Revision: 11963

Log:
Backport r11962 (reversal of r11958).

Modified:
   branches/0.15.x/abcl/src/org/armedbear/lisp/compiler-pass2.lisp

Modified: branches/0.15.x/abcl/src/org/armedbear/lisp/compiler-pass2.lisp
==============================================================================
--- branches/0.15.x/abcl/src/org/armedbear/lisp/compiler-pass2.lisp	(original)
+++ branches/0.15.x/abcl/src/org/armedbear/lisp/compiler-pass2.lisp	Fri May 29 02:14:57 2009
@@ -6188,8 +6188,18 @@
 value for use with derive-type-minus and derive-type-plus.")
 
 (define-int-bounds-derivation - (low1 high1 low2 high2)
-  (values (and low1 high2 (- low1 high2))
-          (and high1 low2 (- high2 low2))))
+  (values (when (and low1 high2) ;; low1 or high2 undefined: no lower bound
+            (if low2
+                (min (- low1 low2)
+                     (- low1 high2))
+                ;; low2 undefined: no effect on lower bound
+                (- low1 high2)))
+          (when (and high1 low2) ;; high1 or low2 undefined: no upper bound
+            (if high2
+                (max (- high1 low2)
+                     (- high1 high2))
+                ;; high2 undefined: no effect on upper bound
+                (- high1 low2)))))
 
 (defun derive-compiler-types (args op)
   (flet ((combine (x y)




More information about the armedbear-cvs mailing list