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
* 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
;;; 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))