summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2023-03-21 20:51:13 -0700
committerKaz Kylheku <kaz@kylheku.com>2023-03-21 20:51:13 -0700
commit4f77a300d19f9e6990509424ccb3333555552d64 (patch)
tree66fc89a2ca5bdd4e301415c82f8f270d81c65b15
parent7f522c011175c97035af61d73b0b013c5ee767ea (diff)
downloadtxr-4f77a300d19f9e6990509424ccb3333555552d64.tar.gz
txr-4f77a300d19f9e6990509424ccb3333555552d64.tar.bz2
txr-4f77a300d19f9e6990509424ccb3333555552d64.zip
compiler: bug: unmatchable pattern in optimizer.
This was uncovered by unused variable warnings. * stdlib/optimize.tl (basic-blocks peephole-block): The pattern trying to detect wasteful register moves is incorrect; the reg1 term is intended to be the @reg1 variable. It is matched literally and so will not match because the symbol reg1 does not literally occur in the VM code.
-rw-r--r--stdlib/optimize.tl2
1 files changed, 1 insertions, 1 deletions
diff --git a/stdlib/optimize.tl b/stdlib/optimize.tl
index 329bae03..7681bca1 100644
--- a/stdlib/optimize.tl
+++ b/stdlib/optimize.tl
@@ -397,7 +397,7 @@
;; wasteful moves
(((mov @reg0 @nil) (mov @reg0 @nil) . @nil)
(cdr insns))
- (((mov @reg0 @reg1) (mov reg1 @reg0) . @rest)
+ (((mov @reg0 @reg1) (mov @reg1 @reg0) . @rest)
(pushnew bl bb.rescan)
(set bb.recalc t)
^(,(car insns) ,*rest))