[LLVMdev] opt + fastcc bug?
Eli Friedman
eli.friedman at gmail.com
Wed Apr 6 22:56:14 PDT 2011
On Wed, Apr 6, 2011 at 10:48 PM, Nicolas Ojeda Bar
<nojb at math.harvard.edu> wrote:
> Hi,
>
> Is this correct behaviour?
>
> test.ll:
>
> declare {} @__ex__print_int(i64)
>
> define i32 @main() {
> entry:
> %0 = call i64 @f.1()
> %1 = call {} @__ex__print_int(i64 %0)
> ret i32 0
> }
>
> define internal fastcc i64 @f.1() {
> entry:
> ret i64 7
> }
>
>> opt -std-compile-opts test.ll -S
>
> ; ModuleID = 'test.ll'
>
> define i32 @main() noreturn nounwind {
> entry:
> tail call void @llvm.trap()
> unreachable
> }
>
> declare void @llvm.trap() nounwind
>
> If I remove fastcc then everything works as expected.
> Does this mean that one shouldn't use opt when you
> use fastcc functions (which are required when implementing
> tail recursive languages!)?
Try "%0 = call fastcc i64 @f.1()"; the conventions of the call and the
callee are required to match.
-Eli
More information about the llvm-dev
mailing list