From bf4aee82dd12d132a82fa39355d66f2ac67c8fc5 Mon Sep 17 00:00:00 2001 From: William Harold Newman Date: Mon, 26 Aug 2002 15:02:15 +0000 Subject: [PATCH] 0.7.7.2: 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 | 13 ------------- NEWS | 5 +++++ src/compiler/constraint.lisp | 9 +++++++-- 3 files changed, 12 insertions(+), 15 deletions(-) diff --git a/BUGS b/BUGS index f4a9efc..52bcab2 100644 --- 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 --- 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 diff --git a/src/compiler/constraint.lisp b/src/compiler/constraint.lisp index e2be093..823a163 100644 --- a/src/compiler/constraint.lisp +++ b/src/compiler/constraint.lisp @@ -110,9 +110,14 @@ ;;; 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)) -- 1.7.10.4