0.8.3.70:
[sbcl.git] / src / compiler / gtn.lisp
index 0aa7f2b..3d6c0c8 100644 (file)
 
   (values))
 
-;;; Return true if FUN's result continuation is used in a
-;;; tail-recursive full call. We only consider explicit :FULL calls.
-;;; It is assumed that known calls are never part of a tail-recursive
-;;; loop, so we don't need to enforce tail-recursion. In any case, we
-;;; don't know which known calls will actually be full calls until
-;;; after LTN.
+;;; Return true if FUN's result is used in a tail-recursive full
+;;; call. We only consider explicit :FULL calls. It is assumed that
+;;; known calls are never part of a tail-recursive loop, so we don't
+;;; need to enforce tail-recursion. In any case, we don't know which
+;;; known calls will actually be full calls until after LTN.
 (defun has-full-call-use (fun)
   (declare (type clambda fun))
   (let ((return (lambda-return fun)))
        (block punt
          (dolist (fun funs t)
            (dolist (ref (leaf-refs fun))
-             (let* ((cont (node-cont ref))
-                    (dest (continuation-dest cont)))
-               (when (and dest
+             (let* ((lvar (node-lvar ref))
+                    (dest (and lvar (lvar-dest lvar))))
+               (when (and (basic-combination-p dest)
                           (not (node-tail-p dest))
-                          (basic-combination-p dest)
-                          (eq (basic-combination-fun dest) cont)
+                          (eq (basic-combination-fun dest) lvar)
                           (eq (basic-combination-kind dest) :local))
                  (return-from punt nil)))))))))
 
                     inhibit-warnings))
       (dolist (fun funs
                   (let ((*compiler-error-context* (lambda-bind (first funs))))
-                    (compiler-note
+                    (compiler-notify
                      "Return value count mismatch prevents known return ~
                       from these functions:~
                       ~{~%  ~A~}"
                (declare (ignore ignore))
                (when (eq count :unknown)
                  (let ((*compiler-error-context* (lambda-bind fun)))
-                   (compiler-note
+                   (compiler-notify
                     "Return type not fixed values, so can't use known return ~
                      convention:~%  ~S"
                     (type-specifier rtype)))
   (multiple-value-bind (types count) (values-types (tail-set-type tails))
     (let ((ptypes (mapcar #'primitive-type types))
          (use-standard (use-standard-returns tails)))
-      (when (and (eq count :unknown) (not use-standard))
+      (when (and (eq count :unknown) (not use-standard)
+                 (not (eq (tail-set-type tails) *empty-type*)))
        (return-value-efficiency-note tails))
       (if (or (eq count :unknown) use-standard)
          (make-return-info :kind :unknown