1.0.35.18: Fix type-derivation for EXPT
authorNathan Froyd <froydnj@cs.rice.edu>
Mon, 22 Feb 2010 21:54:31 +0000 (21:54 +0000)
committerNathan Froyd <froydnj@cs.rice.edu>
Mon, 22 Feb 2010 21:54:31 +0000 (21:54 +0000)
A small thinko in the condition checking for (EXPT <RATIONAL> <RATIONAL>).

NEWS
src/compiler/float-tran.lisp
tests/compiler.pure.lisp
version.lisp-expr

diff --git a/NEWS b/NEWS
index 9d4f7a9..68ac632 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -23,16 +23,18 @@ changes relative to sbcl-1.0.35:
   * bug fix: Fix grammer and style issues for the docstrings of
     printer-related variables and functions.  (Thanks to mon_key; launchpad
     bug lp#518696)
-  * bug fix: fix compilation on chenygc platforms. Thanks to Larry Valkama and
+  * bug fix: Fix compilation on chenygc platforms. Thanks to Larry Valkama and
     Bruce O'Neel.
   * bug fix: SB-THREAD:CONDITION-WAIT sometimes signaled a deadline twice 
     in a row even though a handler defered the deadline long into the
     future. (lp#512914)
-  * bug fix: a deadline handler was run without interrupts enabled for a
+  * bug fix: A deadline handler was run without interrupts enabled for a
     deadline signaled within SB-THREAD:CONDITION-WAIT. That could result
     in infinitely spinning, non-killable threads.
-  * bug fix: backtrace from internal-errors on x86-64 os x was truncated
+  * bug fix: Backtrace from internal-errors on x86-64 os x was truncated
     before reaching the erring stack frame.
+  * bug fix: Fix type derivation for EXPT when raising a fixnum to a
+    real power.  (launchpad bug lp#525949)
 
 changes in sbcl-1.0.35 relative to sbcl-1.0.34:
   * optimization: ROUND with a single single-float or double-float argument
index a1184e1..c9879b9 100644 (file)
          ;; But a positive real to any power is well-defined.
          (merged-interval-expt x y))
         ((and (csubtypep x (specifier-type 'rational))
-              (csubtypep x (specifier-type 'rational)))
+              (csubtypep y (specifier-type 'rational)))
          ;; A rational to the power of a rational could be a rational
          ;; or a possibly-complex single float
          (specifier-type '(or rational single-float (complex single-float))))
index bb495bd..a924be7 100644 (file)
 (with-test (:name :unary-round-type-derivation)
   (let* ((src '(lambda (zone)
                 (multiple-value-bind (h m) (truncate (abs zone) 1.0)
+                  (declare (ignore h))
                   (round (* 60.0 m)))))
          (fun (compile nil src)))
     (assert (= (funcall fun 0.5) 30))))
+
+(with-test (:name :bug-525949)
+  (let* ((src '(lambda ()
+                (labels ((always-one () 1)
+                         (f (z)
+                           (let ((n (funcall z)))
+                             (declare (fixnum n))
+                             (the double-float (expt n 1.0d0)))))
+                  (f #'always-one))))
+         (warningp nil)
+         (fun (handler-bind ((warning (lambda (c)
+                                        (setf warningp t) (muffle-warning c))))
+                (compile nil src))))
+    (assert (not warningp))
+    (assert (= 1.0d0 (funcall fun)))))
index 725a600..c828100 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.35.17"
+"1.0.35.18"