Must invalidate memory for all assignments. Was losing in case where
authorChris Hanson <org/chris-hanson/cph>
Thu, 31 Dec 1987 05:49:33 +0000 (05:49 +0000)
committerChris Hanson <org/chris-hanson/cph>
Thu, 31 Dec 1987 05:49:33 +0000 (05:49 +0000)
destination of assignment was non-volatile and source was volatile.

v7/src/compiler/rtlopt/rcse1.scm

index 6378ba2439707fb91f6a7d5ac7b6317a39898249..3190a773f235487d0b1900411466c5bb3d177a81 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/rtlopt/rcse1.scm,v 4.2 1987/12/30 07:13:08 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/rtlopt/rcse1.scm,v 4.3 1987/12/31 05:49:33 cph Exp $
 
 Copyright (c) 1987 Massachusetts Institute of Technology
 
@@ -193,18 +193,18 @@ MIT in each case. |#
                                      (hash-table-lookup hash address))
                                     (hash-table-delete-class!
                                      element-address-varies?))))))
-                      (cond (volatile?* (memory-invalidate!))
-                            ((not volatile?)
-                             (let ((address
-                                    (find-cheapest-expression address hash
-                                                              false)))
-                               (let ((element (insert-source!)))
-                                 (memory-invalidate!)
-                                 (insert-memory-destination!
-                                  address
-                                  element
-                                  (modulo (+ (symbol-hash 'ASSIGN) hash)
-                                          (hash-table-size))))))))))
+                      (if (or volatile? volatile?*)
+                          (memory-invalidate!)
+                          (let ((address
+                                 (find-cheapest-expression address hash
+                                                           false)))
+                            (let ((element (insert-source!)))
+                              (memory-invalidate!)
+                              (insert-memory-destination!
+                               address
+                               element
+                               (modulo (+ (symbol-hash 'ASSIGN) hash)
+                                       (hash-table-size)))))))))
                 ;; **** Kludge.  Works only because stack-pointer
                 ;; gets used in very fixed way by code generator.
                 (if (stack-push/pop? address)