* incompatible change: ICR structure is changed; the value part of
CONTINUATION is now called LVAR; corresponding functions are
renamed (e.g. SB-C::CONTINUATION-TYPE has become SB-C::LVAR-TYPE).
+ * added type deriver for ISQRT (thanks to Robert E. Brown).
* fixed some bugs revealed by Paul Dietz' test suite:
** the RETURN clause in LOOP is now equivalent to DO (RETURN ...).
** ROUND and FROUND now give the right answer when given very
(declare (integer x))
(etypecase x
((unsigned-byte ,width) x)
- (bignum-element-type (logand x ,pattern))
(fixnum (logand x ,pattern))
(bignum (logand (%bignum-ref x 0) ,pattern)))))
(,name ,@(loop for arg in lambda-list
(let ((result (return-result node)))
(collect ((use-union *empty-type* values-type-union))
(do-uses (use result)
- (cond ((and (basic-combination-p use)
- (eq (basic-combination-kind use) :local))
- (aver (eq (lambda-tail-set (node-home-lambda use))
- (lambda-tail-set (combination-lambda use))))
- (when (combination-p use)
- (when (nth-value 1 (maybe-convert-tail-local-call use))
- (return-from find-result-type (values)))))
- (t
- (use-union (node-derived-type use)))))
+ (let ((use-home (node-home-lambda use)))
+ (cond ((or (eq (functional-kind use-home) :deleted)
+ (block-delete-p (node-block use))))
+ ((and (basic-combination-p use)
+ (eq (basic-combination-kind use) :local))
+ (aver (eq (lambda-tail-set use-home)
+ (lambda-tail-set (combination-lambda use))))
+ (when (combination-p use)
+ (when (nth-value 1 (maybe-convert-tail-local-call use))
+ (return-from find-result-type (values)))))
+ (t
+ (use-union (node-derived-type use))))))
(let ((int
;; (values-type-intersection
;; (continuation-asserted-type result) ; FIXME -- APD, 2002-01-26
(use-union)
;; )
- ))
+ ))
(setf (return-result-type node) int))))
(values))
;;; Deal with deleting the last reference to a CLAMBDA. It is called
;;; in two situations: when the lambda is unreachable (so that its
-;;; body mey be deleted), and when it is an effectless LET (in this
+;;; body may be deleted), and when it is an effectless LET (in this
;;; case its body is reachable and is not completely "its"). We set
;;; FUNCTIONAL-KIND to :DELETED and rely on IR1-OPTIMIZE to delete its
;;; blocks.
(declare (type clambda clambda))
(let ((original-kind (functional-kind clambda))
(bind (lambda-bind clambda)))
- (aver (not (member original-kind '(:deleted :optional :toplevel))))
+ (aver (not (member original-kind '(:deleted :toplevel))))
(aver (not (functional-has-external-references-p clambda)))
(setf (functional-kind clambda) :deleted)
(setf (lambda-bind clambda) nil)
- (when bind ; CLAMBDA is deleted due to unreachability
+ (when bind ; CLAMBDA is deleted due to unreachability
(labels ((delete-children (lambda)
(dolist (child (lambda-children lambda))
- (if (eq (functional-kind child) :deleted)
- (delete-children child)
- (delete-lambda child)))
+ (cond ((eq (functional-kind child) :deleted)
+ (delete-children child))
+ (t
+ (delete-lambda child))))
(setf (lambda-children lambda) nil)
(setf (lambda-parent lambda) nil)))
(delete-children clambda)))
(do-nodes-carefully (node block)
(when (valued-node-p node)
(delete-lvar-use node))
- (typecase node
+ (etypecase node
(ref (delete-ref node))
(cif (flush-dest (if-test node)))
;; The next two cases serve to maintain the invariant that a LET
(when entry
(setf (entry-exits entry)
(delq node (entry-exits entry))))))
+ (entry
+ (dolist (exit (entry-exits node))
+ (mark-for-deletion (node-block exit)))
+ (let ((home (node-home-lambda node)))
+ (setf (lambda-entries home) (delq node (lambda-entries home)))))
(creturn
(flush-dest (return-result node))
(delete-return node))
%source-name
%debug-name
#!+sb-show id
+ kind
(type :test (not (eq type *universal-type*)))
(where-from :test (not (eq where-from :assumed)))
(vars :prin1 (mapcar #'leaf-source-name vars)))
(setf min-len 0))
(specifier-type `(integer ,(or min-len '*) ,(or max-len '*))))))))
+(defoptimizer (isqrt derive-type) ((x))
+ (let ((x-type (lvar-type x)))
+ (when (numeric-type-p x-type)
+ (let* ((lo (numeric-type-low x-type))
+ (hi (numeric-type-high x-type))
+ (lo-res (if lo (isqrt lo) '*))
+ (hi-res (if hi (isqrt hi) '*)))
+ (specifier-type `(integer ,lo-res ,hi-res))))))
+
(defoptimizer (code-char derive-type) ((code))
(specifier-type 'base-char))
c)))
(if (<= 11 c) (%f5) c))))
+;;; two bugs: "aggressive" deletion of optional entries and problems
+;;; of FIND-RESULT-TYPE in dealing with deleted code; reported by
+;;; Nikodemus Siivola (simplified version)
+(defun lisp-error-error-handler (condition)
+ (invoke-debugger condition)
+ (handler-bind ()
+ (unwind-protect
+ (with-simple-restart
+ (continue "return to hemlock's debug loop.")
+ (invoke-debugger condition))
+ (device))))
+
+;;;
+(defun foo ()
+ (labels ((foo (x)
+ (return-from foo x)
+ (block u
+ (labels ((bar (x &optional (y (return-from u)))
+ (list x y (apply #'bar (fee)))))
+ (list (bar 1) (bar 1 2))))
+ (1+ x)))
+ #'foo))
+
\f
(sb-ext:quit :unix-status 104)
;;; 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".)
-"0.8.3.83"
+"0.8.3.84"