Reported by Eric Marsden on sbcl-devel 2011-12-01.
"illegal instruction on PowerPC"
We check for result type being a VALUES-TYPE-P when deciding if to compute
the second value for TRUNCATE or not -- but *WILD-TYPE* isn't a values type.
Make VALUES-TYPE-P return true for it from now on. What could possibly go
wrong? Just two other places need to change, it seems.
account for signed zeros.
* bug fix: compiler error when typechecking a call to a function with
non-constant keyword arguments.
+ * bug fix: misoptimization of TRUNCATE causing erratic behaviour.
changes in sbcl-1.0.54 relative to sbcl-1.0.53:
* minor incompatible changes:
(:include args-type
(class-info (type-class-or-lose 'values)))
(:constructor %make-values-type)
+ (:predicate %values-type-p)
(:copier nil)))
+(declaim (inline value-type-p))
+(defun values-type-p (x)
+ (or (eq x *wild-type*)
+ (%values-type-p x)))
+
(defun-cached (make-values-type-cached
:hash-bits 8
:hash-function (lambda (req opt rest allowp)
1
(values-type-max-value-count type)))
+;;; VALUES type with a single value.
(defun type-single-value-p (type)
- (and (values-type-p type)
+ (and (%values-type-p type)
(not (values-type-rest type))
(null (values-type-optional type))
(singleton-p (values-type-required type))))
(let* ((type (node-derived-type call))
(types
(mapcar #'primitive-type
- (if (values-type-p type)
+ (if (args-type-p type)
(append (args-type-required type)
(args-type-optional type))
(list type))))
(declare (type keyword p3))
(tree-equal p1 (cons 1 2) (the (member :test) p3) p4)))))
(assert (funcall fun (cons 1.0 2.0) :test '=))))
+
+(with-test (:name :truncate-wild-values)
+ (multiple-value-bind (q r)
+ (handler-bind ((warning #'error))
+ (let ((sb-c::*check-consistency* t))
+ (funcall (compile nil
+ `(lambda (a)
+ (declare (type (member 1d0 2d0) a))
+ (block return-value-tag
+ (funcall
+ (the function
+ (catch 'debug-catch-tag
+ (return-from return-value-tag
+ (progn (truncate a)))))))))
+ 2d0)))
+ (assert (eql 2 q))
+ (assert (eql 0d0 r))))