[Git][cmucl/cmucl][sparc64-dev] 2 commits: Fix stack computations in COPY-MORE-ARGS

Raymond Toy rtoy at common-lisp.net
Sun Jan 7 15:51:38 UTC 2018


Raymond Toy pushed to branch sparc64-dev at cmucl / cmucl


Commits:
a94d7f1f by Raymond Toy at 2018-01-06T18:32:24-08:00
Fix stack computations in COPY-MORE-ARGS

Fixnums aren't 8-byte word offsets, so we need to shift fixnums left
by 1 to get a word offset when computing new stack locations.

- - - - -
11e8aafe by Raymond Toy at 2018-01-06T19:02:09-08:00
Fix stack computations in MORE-ARG-CONTEXT

Fixnums aren't 8-byte word offsets, so we need to shift fixnums left
by 1 to get a word offset when computing new stack locations.

- - - - -


1 changed file:

- src/compiler/sparc64/call.lisp


Changes:

=====================================
src/compiler/sparc64/call.lisp
=====================================
--- a/src/compiler/sparc64/call.lisp
+++ b/src/compiler/sparc64/call.lisp
@@ -1141,12 +1141,17 @@ default-value-8
       ;; Allocate the space on the stack.
       (cond ((zerop fixed)
 	     (inst cmp nargs-tn)
+	     ;; Add nargs-tn to csp-tn twice to get the right address
+	     ;; because fixnum values need to be multiplied by two to
+	     ;; get the right word address/offset.
+	     (inst add csp-tn csp-tn nargs-tn)
 	     (inst b :eq done)
 	     (inst add csp-tn csp-tn nargs-tn))
 	    (t
 	     (inst subcc count nargs-tn (fixnumize fixed))
 	     (inst b :le done)
 	     (inst nop)
+	     (inst add csp-tn csp-tn count)
 	     (inst add csp-tn csp-tn count)))
       (when (< fixed register-arg-count)
 	;; We must stop when we run out of stack args, not when we run out of
@@ -1158,6 +1163,7 @@ default-value-8
       (move dst csp-tn)
       ;; Initialize src to be end of args.
       (inst add src cfp-tn nargs-tn)
+      (inst add src cfp-tn nargs-tn)
 
       (emit-label loop)
       ;; *--dst = *--src, --count
@@ -1271,7 +1277,9 @@ default-value-8
   (:generator 5
     (emit-not-implemented)
     (inst sub count supplied (fixnumize fixed))
-    (inst sub context csp-tn count)))
+    ;; Subtract count twice to get the correct word offset.
+    (inst sub context csp-tn count)
+    (inst sub context context count)))
 
 
 ;;; Signal wrong argument count error if Nargs isn't = to Count.



View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/compare/5fa489dfddcbaf53394a1b11ac103fc094023b6c...11e8aafe5be25c1ad2b998546b677209721dd227

---
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/compare/5fa489dfddcbaf53394a1b11ac103fc094023b6c...11e8aafe5be25c1ad2b998546b677209721dd227
You're receiving this email because of your account on gitlab.common-lisp.net.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/cmucl-cvs/attachments/20180107/a7fb76bf/attachment-0001.html>


More information about the cmucl-cvs mailing list