diff --git a/mats/cp0.ms b/mats/cp0.ms index 255911553f..be4a8f0d46 100644 --- a/mats/cp0.ms +++ b/mats/cp0.ms @@ -2815,5 +2815,8 @@ (fields x y)) (if (make-posn 0 ,e) ,v 'other))) posn-decl-expanded) - + (parameterize ([enable-cp0 #t] [#%$suppress-primitive-inlining #f]) + (equivalent-expansion? + (expand/optimize '(let ([g1 (begin (unknown) (void))]) 10)) + '(begin (unknown) 10))) ) diff --git a/s/cp0.ss b/s/cp0.ss index 0de44ec923..68dc4e99d4 100644 --- a/s/cp0.ss +++ b/s/cp0.ss @@ -737,7 +737,10 @@ (cond [(and (eq? ctxt 'effect) (simple? e2)) e1] - [(and (eq? ctxt 'ignored) (simple1? e2)) + [(and (eq? ctxt 'ignored) (simple1? e2) + ;; don't move e1 into a single-value + ;; position unless that's ok + (single-valued? e1)) e1] [else (let ([e1 (nanopass-case (Lsrc Expr) e1