X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Fgtn.lisp;h=3d6c0c857974250e7b65e4d8ed2f985ffb3b5c5d;hb=6a9bbe6f36179cee92001a1f9ed5ff38be512644;hp=571d82c727fde1802c4c9406773a505ba6a94949;hpb=ff57884e206ac28660af6af34315bc9b81697f57;p=sbcl.git diff --git a/src/compiler/gtn.lisp b/src/compiler/gtn.lisp index 571d82c..3d6c0c8 100644 --- a/src/compiler/gtn.lisp +++ b/src/compiler/gtn.lisp @@ -84,12 +84,11 @@ (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))) @@ -116,12 +115,11 @@ (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)))))))))