[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#15533: optimizing away noticeable effects
From: |
Mark H Weaver |
Subject: |
bug#15533: optimizing away noticeable effects |
Date: |
Sun, 06 Oct 2013 03:36:13 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) |
Ian Price <address@hidden> writes:
> scheme@(guile-user)> ,optimize (define (foo f arg)
> (let* ((l '())
> (m (if (pair? arg)
> (begin
> (set! l (cdr arg))
> (car arg))
> arg)))
> (lambda () (apply f m l))))
> $14 = (define (foo f arg)
> (let ((m (if (pair? arg)
> (begin (begin (cdr arg) (if #f #f)) (car arg))
> arg)))
> (lambda () (f m))))
Using git bisect, I've determined that this bug was introduced in the
following commit:
commit d21537efb4a0edea30a7ab801909207d4bb69030
Author: Andy Wingo <address@hidden>
Date: Fri Feb 15 12:11:29 2013 +0100
better inlining of `apply' with rest arguments
* module/language/tree-il/peval.scm (peval): Move up the find-definition
helper. Use it to speculatively destructure conses and lists into the
tail position of an `apply' form.
* test-suite/tests/peval.test ("partial evaluation"): Add tests.
Andy, would you be willing to investigate further?
Mark