[LLVMdev] Possible bug in TCO?

Samuel Crow samuraileumas at yahoo.com
Wed Nov 25 10:26:36 PST 2009


Hi Jon,

The last I heard about tail calls was http://lists.cs.uiuc.edu/pipermail/llvmdev/2009-November/027355.html when you questioned why doing tail calls with no optimization caused llc to barf.

It mentions a revision number but that post is only a few days old so I hope it is fixed in the trunk.

--Sam Crow



----- Original Message ----
> From: Jon Harrop <jon at ffconsultancy.com>
> To: llvmdev at cs.uiuc.edu
> Sent: Wed, November 25, 2009 1:19:28 PM
> Subject: [LLVMdev] Possible bug in TCO?
> 
> 
> My compiler is generating a bunch of code including the following line:
> 
>   %57 = call fastcc i32 @aux(%1* %0, %1 %1, %1 %46, i32 0, %4 %2) ; 
> [#uses=1]
>   ret i32 %57
> 
> The program works fine as long as this isn't a tail call. If I compile via 
> a .ll and insert "tail" by hand, the program segfaults. However, if I make it 
> a tail call and return an undef i8* or void instead of the i32 0 then it 
> works (the source code is returning the value () of the type unit in ML, so 
> it conveys no information and can be returned as anything). That makes me 
> think this has been a bug in LLVM rather than in my own code.
> 
> I'm using LLVM 2.6. Anyone recognise this as a bug in TCO fixed since then or 
> should I try to boil it down and submit it?
> 
> -- 
> Dr Jon Harrop, Flying Frog Consultancy Ltd.
> http://www.ffconsultancy.com/?e
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev



      



More information about the llvm-dev mailing list