From dfa02ba434ca4e6d7f55c5d1ecd31c949e76cbc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Kochma=C5=84ski?= Date: Thu, 30 Nov 2023 08:31:54 +0100 Subject: [PATCH] cmp: unwind-label: relax conditions for carrying the value There is no need to carry the location value across the unwind when the destination is not special, because then we may assign the destination before we unwind the stack. That allows us to skip examining the unwind requirements. --- src/cmp/cmpbackend-cxx/cmppass2-exit.lsp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/cmp/cmpbackend-cxx/cmppass2-exit.lsp b/src/cmp/cmpbackend-cxx/cmppass2-exit.lsp index 041785fad..1555b9cbe 100644 --- a/src/cmp/cmpbackend-cxx/cmppass2-exit.lsp +++ b/src/cmp/cmpbackend-cxx/cmppass2-exit.lsp @@ -152,10 +152,9 @@ ;; This operator does not cross the function boundary. (assert (null exit-p)) (cond ((and (destination-value-matters-p *destination*) - (or (plusp frs-bind) bds-lcl (plusp bds-bind) stack-frame) - (or (loc-refers-to-special-p loc) - (loc-refers-to-special-p *destination*))) - ;; Save the value if LOC may possibly refer to special binding. + (loc-refers-to-special-p *destination*)) + ;; Save the value if *DESTINATION* may possibly refer to special + ;; binding. Otherwise we may set *DESTINATION* /before/ the unwind. (let* ((*temp* *temp*) (temp (make-temp-var))) (set-loc temp loc)