bugGuile - Bugs: bug #34300, Misplaced tail call optimization...

 
 

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

Submitted by:  Ludovic Courtès <civodul>
Submitted on:  Thu 15 Sep 2011 09:17:38 PM UTC  
 
Category: NoneSeverity: 4 - Important
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: None
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Thu 15 Sep 2011 09:17:38 PM UTC, original submission:

Consider this example:

#v+
(define bar
(lambda ()
(let ((fail (lambda () 'fail)))
(let loop ((a (iota 3)))
(if (pair? a)
(loop (cdr a))
(fail)))
(pk 'done))))
#v-

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.

Ludovic Courtès <civodul>
Project Administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by wingo (Updated the item)
  • -unavailable- added by civodul (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 20 Oct 2011 10:32:22 PM UTCwingoStatusNone=>Fixed
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1