From: Chris Hanson <org/chris-hanson/cph>
Date: Fri, 3 Jun 1988 23:54:57 +0000 (+0000)
Subject: (cse/assign) Notice pops from stack and adjust stack pointer
X-Git-Tag: 20090517-FFI~12739
X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=41ab51089ac5961a5c4e000c412b0c35e7df65f9;p=mit-scheme.git

(cse/assign) Notice pops from stack and adjust stack pointer
accordingly.  Can't understand why this wasn't noticed before.
---

diff --git a/v7/src/compiler/rtlopt/rcse1.scm b/v7/src/compiler/rtlopt/rcse1.scm
index 43d6949f5..ca9ecf9b7 100644
--- a/v7/src/compiler/rtlopt/rcse1.scm
+++ b/v7/src/compiler/rtlopt/rcse1.scm
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/rtlopt/rcse1.scm,v 4.8 1988/06/03 14:54:29 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/rtlopt/rcse1.scm,v 4.9 1988/06/03 23:54:57 cph Exp $
 
 Copyright (c) 1987 Massachusetts Institute of Technology
 
@@ -212,11 +212,14 @@ MIT in each case. |#
 							hash
 							insert-source!
 							memory-invalidate!)))))
-		 ;; **** Kludge.  Works only because stack-pointer
-		 ;; gets used in very fixed way by code generator.
-		 (if (stack-push/pop? address)
-		     (stack-pointer-adjust!
-		      (rtl:address-number address))))))))))
+		 (notice-push/pop! address)))))
+      (notice-push/pop! (rtl:assign-expression statement)))))
+
+(define (notice-push/pop! expression)
+  ;; **** Kludge.  Works only because stack-pointer
+  ;; gets used in very fixed way by code generator.
+  (if (stack-push/pop? expression)
+      (stack-pointer-adjust! (rtl:address-number expression))))
 
 (define (assignment-memory-insertion address hash insert-source!
 				     memory-invalidate!)