X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Fgtn.lisp;h=c1fb1c72e59ef4763f3461fe35012ca300f7048b;hb=94ea2b2082deaa0331dfb66fa6af6ca12dd8dc83;hp=571d82c727fde1802c4c9406773a505ba6a94949;hpb=ff57884e206ac28660af6af34315bc9b81697f57;p=sbcl.git diff --git a/src/compiler/gtn.lisp b/src/compiler/gtn.lisp index 571d82c..c1fb1c7 100644 --- a/src/compiler/gtn.lisp +++ b/src/compiler/gtn.lisp @@ -68,7 +68,8 @@ (if (lambda-var-indirect thing) *backend-t-primitive-type* (primitive-type (leaf-type thing)))) - (nlx-info *backend-t-primitive-type*)))) + (nlx-info *backend-t-primitive-type*) + (clambda *backend-t-primitive-type*)))) (push (cons thing (make-normal-tn ptype)) reversed-ir2-physenv-alist))) @@ -84,12 +85,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 +116,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))))))))) @@ -139,8 +138,8 @@ (let ((*compiler-error-context* (lambda-bind (first funs)))) (compiler-notify "Return value count mismatch prevents known return ~ - from these functions:~ - ~{~% ~A~}" + from these functions:~ + ~{~% ~A~}" (mapcar #'leaf-source-name (remove-if-not #'leaf-has-source-name-p funs))))) (let ((ret (lambda-return fun))) @@ -152,7 +151,7 @@ (let ((*compiler-error-context* (lambda-bind fun))) (compiler-notify "Return type not fixed values, so can't use known return ~ - convention:~% ~S" + convention:~% ~S" (type-specifier rtype))) (return))))))))) (values)) @@ -211,6 +210,8 @@ (make-ir2-nlx-info :home (when (member (cleanup-kind (nlx-info-cleanup nlx)) '(:block :tagbody)) - (make-normal-tn *backend-t-primitive-type*)) + (if (nlx-info-safe-p nlx) + (make-normal-tn *backend-t-primitive-type*) + (make-stack-pointer-tn))) :save-sp (make-nlx-sp-tn physenv))))) (values))