PRE-INCREMENT is only ever a memory reference, not address, in RTL.
authorTaylor R Campbell <campbell@mumble.net>
Sat, 28 Aug 2010 20:48:47 +0000 (20:48 +0000)
committerTaylor R Campbell <campbell@mumble.net>
Sat, 28 Aug 2010 20:48:47 +0000 (20:48 +0000)
src/compiler/machines/svm/lapgen.scm

index 3bf029f75990f049354625f1086548afd908e03a..583e589ba7295986bc2308fe3385bd6fa8b8fce7 100644 (file)
@@ -294,18 +294,21 @@ USA.
                      (values scale
                              (ea:indexed (word-source base)
                                          offset scale*
-                                         (word-source index) scale)))
-       (rule-matcher (POST-INCREMENT (REGISTER (? base)) 1)
-                     (values 'WORD
-                             (ea:post-increment (word-source base) 'WORD)))
-       (rule-matcher (PRE-INCREMENT (REGISTER (? base)) -1)
-                     (values 'WORD
-                             (ea:pre-decrement (word-source base) 'WORD)))))
+                                         (word-source index) scale)))))
 
 (define memory-ref-rules
-  (make-memory-rules
-   (lambda (expression)
-     (offset-operator? expression))))
+  (append
+   (make-memory-rules
+    (lambda (expression)
+      (offset-operator? expression)))
+   ;; There is no POST-INCREMENT-ADDRESS or PRE-INCREMENT-ADDRESS, so
+   ;; these rules have no analogue in MEMORY-ADDRESS-RULES.
+   (list (rule-matcher (POST-INCREMENT (REGISTER (? base)) 1)
+                      (values 'WORD
+                              (ea:post-increment (word-source base) 'WORD)))
+        (rule-matcher (PRE-INCREMENT (REGISTER (? base)) -1)
+                      (values 'WORD
+                              (ea:pre-decrement (word-source base) 'WORD))))))
 
 (define memory-address-rules
   (make-memory-rules