From a47e3409d6ceed6f6fbbff975a35e1a340c22309 Mon Sep 17 00:00:00 2001 From: Taylor R Campbell Date: Sat, 28 Aug 2010 20:48:47 +0000 Subject: [PATCH] PRE-INCREMENT is only ever a memory reference, not address, in RTL. --- src/compiler/machines/svm/lapgen.scm | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/compiler/machines/svm/lapgen.scm b/src/compiler/machines/svm/lapgen.scm index 3bf029f75..583e589ba 100644 --- a/src/compiler/machines/svm/lapgen.scm +++ b/src/compiler/machines/svm/lapgen.scm @@ -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 -- 2.25.1