[llvm-bugs] [Bug 26789] New: llc code generation for lambda

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Mar 1 10:31:29 PST 2016


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

            Bug ID: 26789
           Summary: llc code generation for lambda
           Product: new-bugs
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: paz215 at lehigh.edu
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Test code:

void f(const std::string& arg = "Main")
{
    std::cout << arg ;
}

auto fp() -> void(*)(const std::string&)
{
    return f;
}

int main()
{
    fp()("Pointer");
}

Using both versions (3.7 and 3.9), it fails with an segmentation fault with
llc:

$ llc-3.7 -march=cpp test.ll  -o  ir_lambda.cpp
0  libLLVM-3.7.so.1 0x00007fc945bb4900
llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 64
1  libLLVM-3.7.so.1 0x00007fc945bb3d61
2  libc.so.6        0x00007fc944fb52b0
3  libc.so.6        0x00007fc9450cd906
4  libLLVM-3.7.so.1 0x00007fc945be15a1 llvm::raw_ostream::copy_to_buffer(char
const*, unsigned long) + 49
5  libLLVM-3.7.so.1 0x00007fc945be164c llvm::raw_ostream::write(char const*,
unsigned long) + 92
6  libLLVM-3.7.so.1 0x00007fc94642da91
7  libLLVM-3.7.so.1 0x00007fc9464312fc
8  libLLVM-3.7.so.1 0x00007fc9464316c9
9  libLLVM-3.7.so.1 0x00007fc94643250c
10 libLLVM-3.7.so.1 0x00007fc945e6c7b4
llvm::legacy::PassManagerImpl::run(llvm::Module&) + 772
11 llc-3.7          0x000000000041419b
12 llc-3.7          0x000000000040e608 main + 392
13 libc.so.6        0x00007fc944fa0a00 __libc_start_main + 240
14 llc-3.7          0x000000000040e679 _start + 41
Stack dump:
0.      Program arguments: llc-3.7 -march=cpp func-call.ll -o ir_func.cpp
1.      Running pass 'C++ backend' on module 'func-call.ll'.
Segmentation fault (core dumped)

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20160301/6f7b6d8c/attachment-0001.html>


More information about the llvm-bugs mailing list