0.7.7.2:
authorWilliam Harold Newman <william.newman@airmail.net>
Mon, 26 Aug 2002 15:02:15 +0000 (15:02 +0000)
committerWilliam Harold Newman <william.newman@airmail.net>
Mon, 26 Aug 2002 15:02:15 +0000 (15:02 +0000)
merged APD bug120a patch (sbcl-devel 2002-08-21)
deleted "TODO: convert to AVER" note from original patch,
replaced it with justification from discussion in
cmucl-imp (esp. Alexey's message 2002-08-23)
The function has gotten large enough that I really doubt that
the DECLAIM INLINE helps, so I deleted it.

BUGS
NEWS
src/compiler/constraint.lisp

diff --git a/BUGS b/BUGS
index f4a9efc..52bcab2 100644 (file)
--- a/BUGS
+++ b/BUGS
@@ -659,19 +659,6 @@ WORKAROUND:
    Raymond Toy comments that this is tricky on the X86 since its FPU
    uses 80-bit precision internally.
 
-120a:
-   The compiler incorrectly figures the return type of 
-       (DEFUN FOO (FRAME UP-FRAME)
-         (IF (OR (NOT FRAME)
-                 T)
-             FRAME
-             "BAR"))
-   as NIL.
-
-   This problem exists in CMU CL 18c too. When I reported it on
-   cmucl-imp@cons.org, Raymond Toy replied 23 Aug 2001 with 
-   a partial explanation, but no fix has been found yet.
-
 120b:
    Even in sbcl-0.pre7.x, which is supposed to be free of the old
    non-ANSI behavior of treating the function return type inferred
diff --git a/NEWS b/NEWS
index 8d8b505..593c4a9 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1250,6 +1250,11 @@ changes in sbcl-0.7.7 relative to sbcl-0.7.6:
   * The fasl file version number has changed again. (because of the
     bug fix involving the names of PCL MAKE-INSTANCE functions)
 
+changes in sbcl-0.7.8 relative to sbcl-0.7.7:
+  * fixed bug 120a: The compiler now deals correctly with IFs where
+    the consequent is the same as the alternative, instead of
+    misderiving the return type. (thanks to Alexey Dejneka)
+
 planned incompatible changes in 0.7.x:
 * When the profiling interface settles down, maybe in 0.7.x, maybe
   later, it might impact TRACE. They both encapsulate functions, and
index e2be093..823a163 100644 (file)
 
 ;;; Add complementary constraints to the consequent and alternative
 ;;; blocks of IF. We do nothing if X is NIL.
-#!-sb-fluid (declaim (inline add-complement-constraints))
 (defun add-complement-constraints (if fun x y not-p)
-  (when x
+  (when (and x
+            ;; Note: Even if we do (IF test exp exp) => (PROGN test exp)
+            ;; optimization, the *MAX-OPTIMIZE-ITERATIONS* cutoff means
+            ;; that we can't guarantee that the optimization will be
+            ;; done, so we still need to avoid barfing on this case.
+             (not (eq (if-consequent if)
+                      (if-alternative if))))
     (add-test-constraint (if-consequent if) fun x y not-p)
     (add-test-constraint (if-alternative if) fun x y (not not-p)))
   (values))