GNU bug report logs - #9769
Misplaced tail call optimization

Previous Next

Package: guile;

Reported by: ludo <at> gnu.org (Ludovic Courtès)

Date: Sun, 16 Oct 2011 20:30:02 UTC

Severity: normal

Done: Andy Wingo <wingo <at> pobox.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: ludo <at> gnu.org (Ludovic Courtès)
Subject: bug#9769: closed (Re: bug#9769: Misplaced tail call optimization)
Date: Thu, 20 Oct 2011 21:53:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#9769: Misplaced tail call optimization

which was filed against the guile package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 9769 <at> debbugs.gnu.org.

-- 
9769: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9769
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Andy Wingo <wingo <at> pobox.com>
To: ludo <at> gnu.org (Ludovic Courtès)
Cc: 9769-done <at> debbugs.gnu.org
Subject: Re: bug#9769: Misplaced tail call optimization
Date: Thu, 20 Oct 2011 23:51:20 +0200
Fixed in git.  Thanks for the report!

commit aa9c19858872a135ea959066fff26f86527a1bd0
Author: Andy Wingo <wingo <at> pobox.com>
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/

[Message part 3 (message/rfc822, inline)]
From: ludo <at> gnu.org (Ludovic Courtès)
To: bug-guile <at> gnu.org
Subject: Misplaced tail call optimization
Date: Sun, 16 Oct 2011 22:29:00 +0200
(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'.



This bug report was last modified 13 years and 275 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.