summaryrefslogtreecommitdiff
path: root/module/language
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2021-05-24 11:07:14 +0200
committerAndy Wingo <wingo@pobox.com>2021-05-24 11:09:24 +0200
commit17aab66e75136cf23c7f0d4942b61d6947f98f9b (patch)
treee02324740728284c9a749399bfb6f9cc253dfe2c /module/language
parentf499754bc8291a044c5034b634ac02a01bde9b49 (diff)
downloadguile-17aab66e75136cf23c7f0d4942b61d6947f98f9b.tar.gz
Fix bug in eq-constant? propagation in CSE if kf == kt
* module/language/cps/cse.scm (compute-out-edges): Only propagate constant to successor if successor not kf. * test-suite/tests/compiler.test ("cse auxiliary definitions"): ("closure conversion"): Refactor. ("constant propagation"): New test. Fixes #48368.
Diffstat (limited to 'module/language')
-rw-r--r--module/language/cps/cse.scm6
1 files changed, 3 insertions, 3 deletions
diff --git a/module/language/cps/cse.scm b/module/language/cps/cse.scm
index 55cf5490e..47c0f90e6 100644
--- a/module/language/cps/cse.scm
+++ b/module/language/cps/cse.scm
@@ -360,9 +360,9 @@ for a label, it isn't known to be constant at that label."
(_ bool))
(match (and (< pred succ) (intmap-ref out pred))
(($ $kargs _ _ ($ $branch kf kt src 'eq-constant? c (v)))
- (if (eqv? kt succ)
- (adjoin-constant consts v c)
- consts))
+ (if (eqv? kf succ)
+ consts
+ (adjoin-constant consts v c)))
(_ consts)))))))
(define (propagate-analysis analysis label out)