[LLVMbugs] [Bug 14112] New: llvm doesn't tail call a x86_fastcallcc function

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Oct 17 22:16:07 PDT 2012


http://llvm.org/bugs/show_bug.cgi?id=14112

             Bug #: 14112
           Summary: llvm doesn't tail call a x86_fastcallcc function
           Product: libraries
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Backend: X86
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: rafael.espindola at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


Noticed while debugging something else. Given

void __attribute__((fastcall)) foo(int *x);
void bar(int *x) {
  foo(x);
}

gcc produces

bar:
        movl    4(%esp), %ecx
        jmp     foo

clang produces good IR:

define void @bar(i32* %x) nounwind optsize {
  tail call x86_fastcallcc void @foo(i32* %x) nounwind optsize
  ret void
}

but llvm still produces a call:

bar:                                    # @bar
# BB#0:
        subl    $12, %esp
        movl    16(%esp), %ecx
        calll   foo
        addl    $12, %esp
        ret
.Ltmp0:
        .size   bar, .Ltmp0-bar

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list