https://llvm.org/bugs/show_bug.cgi?id=28417

            Bug ID: 28417
           Summary: missing tailcall optimization
           Product: libraries
           Version: 3.8
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Common Code Generator Code
          Assignee: unassignedb...@nondot.org
          Reporter: vanya...@gmail.com
                CC: llvm-bugs@lists.llvm.org
    Classification: Unclassified

For this code LLVM generates code that doesn't use tailcall optimization.

struct token
{
    char const* tok_start;
    char const* tok_end;
    int tok_type;
    unsigned identifier_hash;
};

token f();

token g()
{
  return f();
}

Generated code:

g():                                  # @g()
        pushq   %rbx
        movq    %rdi, %rbx
        callq   f()
        movq    %rbx, %rax
        popq    %rbx
        retq



Expected code:

g():                                  # @g()
        jmpq    f()

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to