[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #34300] Misplaced tail call optimization [2.0.2+]

From: Ludovic Courtès
Subject: [bug #34300] Misplaced tail call optimization [2.0.2+]
Date: Thu, 15 Sep 2011 21:17:40 +0000
User-agent: Mozilla/5.0 (GNU; rv: Gecko/20100107 IceCat/3.6 (like Firefox/3.6)


                 Summary: Misplaced tail call optimization [2.0.2+]
                 Project: Guile
            Submitted by: civodul
            Submitted on: Thu 15 Sep 2011 09:17:38 PM GMT
                Category: None
                Severity: 4 - Important
              Item Group: None
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any



Consider this example:

(define bar
  (lambda ()
    (let ((fail (lambda () 'fail)))
      (let loop ((a (iota 3)))
        (if (pair? a)
            (loop (cdr a))
      (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

To reproduce the test, turn partial evaluation off---otherwise the call to
`fail' is inlined and the problem doesn't show up.


Reply to this item at:


  Message sent via/by Savannah

reply via email to

[Prev in Thread] Current Thread [Next in Thread]