1.0.30.52: fix for multiple-value TRUNCATE
authorChristophe Rhodes <csr21@cantab.net>
Wed, 26 Aug 2009 17:01:49 +0000 (17:01 +0000)
committerChristophe Rhodes <csr21@cantab.net>
Wed, 26 Aug 2009 17:01:49 +0000 (17:01 +0000)
Regression from 1.0.30 (in 1.0.30.28); Noted by Lars Nostdal; fix by
Paul Khuong

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

index 6a51a47..a1184e1 100644 (file)
                                         (,type
                                          &optional (or ,type ,@other-float-arg-types integer))
                                         * :result result)
-                  (let ((result-type (lvar-type result)))
+                  (let ((result-type (lvar-derived-type result)))
                     (if (or (not y)
                             (and (constant-lvar-p y) (= 1 (lvar-value y))))
                         (if (values-type-p result-type)
index fd89794..5d3c463 100644 (file)
     (assert (or (= ret (+ (* 5 256) 4)) (= ret (+ (* 4 256) 5))))))
 
 (with-test (:name :coerce-type-warning)
-  (dolist (type '(t (unsigned-byte 8) (unsigned-byte 16) (unsigned-byte 32) 
+  (dolist (type '(t (unsigned-byte 8) (unsigned-byte 16) (unsigned-byte 32)
                   (signed-byte 8) (signed-byte 16) (signed-byte 32)))
     (multiple-value-bind (fun warningsp failurep)
         (compile nil `(lambda (x)
       (assert (null warningsp))
       (assert (null failurep))
       (assert (typep (funcall fun #(1)) `(simple-array ,type (*)))))))
+
+(with-test (:name :truncate-double-float)
+  (let ((fun (compile nil `(lambda (x)
+                             (multiple-value-bind (q r)
+                                 (truncate (coerce x 'double-float))
+                               (declare (type unsigned-byte q)
+                                        (type double-float r))
+                               (list q r))))))
+    (assert (equal (funcall fun 1.0d0) '(1 0.0d0)))))
index 044d9aa..1dd0551 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.30.51"
+"1.0.30.52"