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

           Summary: segfault with dynamic alloca+call combination
           Product: new-bugs
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Keywords: regression
          Severity: normal
          Priority: P2
         Component: new bugs
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]


To reproduce:

$ llc bar.bc

on a x86-32 linux machine with llvm release_25 branch rev 63833

-

The the attached bitcode is from a simple reduced testcase written in D:

private import tango.stdc.stdlib : alloca;
ubyte[] binaryDigest(ubyte[] buffer) { return null; }
void hexDigest (char[] buffer, uint ds) {
        ubyte[] buf = (cast(ubyte *) alloca(ds))[0..ds];
        ubyte[] ret = binaryDigest(buf);
}

the attached bitcode was generated by LDC.

This code works with LLVM 2.4, but with LLVM 2.5 it segfaults inside LLVM
codegen:

..

Program received signal SIGSEGV, Segmentation fault.

..

#0  llvm::X86RegisterInfo::eliminateCallFramePseudoInstr (this=0xa617f58,
m...@0xa656000, m...@0xa6570f0, I=
      {<bidirectional_iterator<llvm::MachineInstr, int>> =
{<std::iterator<std::bidirectional_iterator_tag, llvm::MachineInstr, int,
llvm::MachineInstr*, llvm::MachineInstr&>> = {<No data fields>}, <No data
fields>}, NodePtr = 0xa6574f8}) at
/usr/lib/gcc/i686-pc-linux-gnu/4.3.3/../../../../include/c++/4.3.3/bits/stl_vector.h:485
#1  0x08564b97 in calculateCalleeSavedRegisters (this=0xa64db60, f...@0xa656000)
at PrologEpilogInserter.cpp:173
#2  0x0856636e in runOnMachineFunction (this=0xa64db60, f...@0xa656000) at
PrologEpilogInserter.cpp:70
#3  0x08864a51 in llvm::FPPassManager::runOnFunction (this=0xa63f0e0,
f...@0xa621ed8) at PassManager.cpp:1323
#4  0x08864e27 in llvm::FunctionPassManagerImpl::run (this=0xa63e8b8,
f...@0xa621ed8) at PassManager.cpp:1281
#5  0x08864fd5 in llvm::FunctionPassManager::run (this=0xbfc194a0,
f...@0xa621ed8) at PassManager.cpp:1226
#6  0x081fa409 in write_asm_to_file (targ...@0xa617e58, m...@0xa616e48,
o...@0xbfc198a8)
    at /home/tomas/ldc/gen/toobj.cpp:312


-- 
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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to