bc: fix optimizer bug
Fix inlining problem when inlining has been explicitly disabled. Closes #3309
This commit is contained in:
parent
ec0ec8e970
commit
89831c01f6
|
@ -6619,6 +6619,28 @@
|
|||
n)])
|
||||
(lambda (x) (h x)))))
|
||||
|
||||
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Regression test related to single-use variables
|
||||
;; and disabled inlining
|
||||
|
||||
(parameterize ([compile-context-preservation-enabled #t]
|
||||
[current-namespace (make-base-namespace)])
|
||||
(void
|
||||
(compile
|
||||
'(module m racket/base
|
||||
(letrec ([f (lambda () 0)]
|
||||
[g (let ([g2
|
||||
(lambda ()
|
||||
(let ([x (f)])
|
||||
(list (lambda () x) h)))])
|
||||
g2)]
|
||||
[h (letrec ([loop
|
||||
(lambda ()
|
||||
(let ([y (g)])
|
||||
(list y loop)))])
|
||||
loop)])
|
||||
h)))))
|
||||
|
||||
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(report-errs)
|
||||
|
|
|
@ -9622,7 +9622,7 @@ Scheme_Object *optimize_expr(Scheme_Object *expr, Optimize_Info *info, int conte
|
|||
int save_fuel = info->inline_fuel, save_no_types = info->no_types;
|
||||
int save_vclock, save_aclock, save_kclock, save_sclock;
|
||||
info->size -= 1;
|
||||
info->inline_fuel = 0; /* no more inlining; o->expr was already optimized */
|
||||
info->inline_fuel = -1; /* no more inlining; o->expr was already optimized */
|
||||
info->no_types = 1; /* cannot used inferred types, in case `val' inferred them */
|
||||
save_vclock = info->vclock; /* allowed to move => no change to clocks */
|
||||
save_aclock = info->aclock;
|
||||
|
|
Loading…
Reference in New Issue
Block a user