[LLVMdev] opt -std-compile-opts breaks tail calls

Chris Lattner clattner at apple.com
Fri Nov 13 08:26:01 PST 2009


On Nov 13, 2009, at 3:34 AM, Jon Harrop wrote:

>> Point 4 is the one that caused me trouble for some time.  
>> Unfortunately
>> it causes a bad interaction with the optimiser, specifically the
>> 'simplifycfg' pass. What seems to happen is that since the function
>> you are calling is marked with 'noreturn', the simplifycfg pass will
>> then put a 'unreachable' statement after the tail call to that
>> function. This stuffs up the tail call though as the llc compiler
>> requires tail calls be followed by a 'return void' statement. In my
>> case this caused my compiled programs to segfault if the llvm
>> optimiser was run on them.
>
> Isn't that a bug in LLVM?

Yes, please file a bugzilla with a small example.

-Chris



More information about the llvm-dev mailing list