summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2023-05-04 20:44:01 -0700
committerKaz Kylheku <kaz@kylheku.com>2023-05-04 20:44:01 -0700
commit838a61f63036891f465d63a478a37410ba649412 (patch)
treefa1c3d2e53cf7aa93cabbe5fe45ab213b1f97219
parentc7069b91d6b2889d0a87735f2a9501c85cb3e7ff (diff)
downloadtxr-838a61f63036891f465d63a478a37410ba649412.tar.gz
txr-838a61f63036891f465d63a478a37410ba649412.tar.bz2
txr-838a61f63036891f465d63a478a37410ba649412.zip
compiler: bugfix: wrong condition in late-peephole.
* stdlib/optimize.tl (basic-blocks late-peephole): The test whether lab2 is used is bogus, and will never be true. The correct test is simply whether the block has two or more rlinks. This makes no difference in the standard library images. When the bug appears, the manifestation would be that a needed label is deleted, resulting in an exception from the assembler.
-rw-r--r--stdlib/optimize.tl2
1 files changed, 1 insertions, 1 deletions
diff --git a/stdlib/optimize.tl b/stdlib/optimize.tl
index bf82e5c1..9950d934 100644
--- a/stdlib/optimize.tl
+++ b/stdlib/optimize.tl
@@ -642,7 +642,7 @@
@lab1
. @rest)
(let* ((bl [bb.hash lab2]))
- (if (some bl.rlinks (op eq bb) .next)
+ (if (cdr bl.rlinks)
insns
^((ifq ,reg (t 0) ,lab3)
,lab1