--- Begin Message ---
Subject: |
Misplaced tail call optimization |
Date: |
Sun, 16 Oct 2011 22:29:00 +0200 |
User-agent: |
Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.90 (gnu/linux) |
(This is a copy of <http://savannah.gnu.org/bugs/?34300>, so it doesn't
get lost. :-))
Consider this example:
(define bar
(lambda ()
(let ((fail (lambda () 'fail)))
(let loop ((a (iota 3)))
(if (pair? a)
(loop (cdr a))
(fail)))
(pk 'done))))
This function should return 'done but it instead returns 'fail, because both
the call to `loop' and the call to `fail' are compiled as if they were tail
calls.
To reproduce the test, turn partial evaluation off---otherwise the call to
`fail' is inlined and the problem doesn't show up.
Ludo'.
--- End Message ---
--- Begin Message ---
Subject: |
Re: bug#9769: Misplaced tail call optimization |
Date: |
Thu, 20 Oct 2011 23:51:20 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) |
Fixed in git. Thanks for the report!
commit aa9c19858872a135ea959066fff26f86527a1bd0
Author: Andy Wingo <address@hidden>
Date: Thu Oct 20 23:50:05 2011 +0200
fix misallocation of some <fix> procedures
* module/language/tree-il/analyze.scm (analyze-lexicals): When stepping
into a non-tail form, we know that labels allocation will be invalid,
so use an empty labels set. Fixes http://debbugs.gnu.org/9769.
* test-suite/tests/tree-il.test ("labels allocation"): Add a test.
--
http://wingolog.org/
--- End Message ---