1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-09 21:40:33 +02:00

Fix effects analysis bug for synthesized definitions at allocations

* module/language/cps/effects-analysis.scm (compute-known-allocations):
For a primcall that allocates, sometimes we will synthesize auxiliary
definitions as part of CSE, for example to indicate that if (cons x y)
is bound to z, that a later call to (car z) should give x unless there
might be an intervening set-car!.  We had a bug in which aux definitions
attached to allocations were being incorrectly associated with the first
operand.  Probably this is a bug in other contexts but it really starts
to hit with the high-level constructors, e.g. `box`.
This commit is contained in:
Andy Wingo 2023-06-22 14:34:49 +02:00
parent 98178ac308
commit e7e625b773

View file

@ -268,6 +268,7 @@ loads from objects created at known allocation sites."
(lambda (label fx out) (lambda (label fx out)
(cond (cond
((causes-all-effects? fx) out) ((causes-all-effects? fx) out)
((logtest fx &allocation) out)
((logtest fx (logior &read &write)) ((logtest fx (logior &read &write))
(match (intmap-ref conts label) (match (intmap-ref conts label)
;; Assume that instructions which cause a known set of effects ;; Assume that instructions which cause a known set of effects