[LLVMbugs] [Bug 7683] New: PBQP register allocator segfaults on null pointer

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Jul 21 03:50:41 PDT 2010


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

           Summary: PBQP register allocator segfaults on null pointer
           Product: new-bugs
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: gergo at complang.tuwien.ac.at
                CC: llvmbugs at cs.uiuc.edu


Created an attachment (id=5249)
 --> (http://llvm.org/bugs/attachment.cgi?id=5249)
Bitcode file containing a function on which the PBQP register allocator
segfaults

On the attached bitcode file (edge_draw.ll), the PBQP register allocator
segfaults on encountering a null pointer.

To reproduce, run: llc -regalloc=pbqp edge_draw.ll

The stack trace from GDB is:

#0  0x0000000000f31b9a in llvm::IndexListEntry::getIndex (this=0x0)
    at /raid0/gergo/svn_llvm/llvm/include/llvm/CodeGen/SlotIndexes.h:82
#1  0x0000000000f31df2 in llvm::SlotIndex::getIndex (this=0x1b2daa0)
    at /raid0/gergo/svn_llvm/llvm/include/llvm/CodeGen/SlotIndexes.h:146
#2  0x0000000000f31f5a in llvm::SlotIndex::operator<= (this=0x1b2daa0, other=
        {static PHI_BIT = 4, lie = {Value = 28464610}})
    at /raid0/gergo/svn_llvm/llvm/include/llvm/CodeGen/SlotIndexes.h:218
#3  0x0000000000ff5fb8 in llvm::LiveInterval::overlapsFrom (this=0x1b2bcc0, 
    other=@0x1b2da80, StartPos=0x1b2daa0)
    at /raid0/gergo/svn_llvm/llvm/lib/CodeGen/LiveInterval.cpp:129
#4  0x0000000000f4ec4d in llvm::LiveInterval::overlaps (this=0x1b2bcc0, 
    other=@0x1b2da80)
    at /raid0/gergo/svn_llvm/llvm/include/llvm/CodeGen/LiveInterval.h:468
#5  0x0000000000f4038b in constructPBQPProblem (this=0x1af2920)
    at /raid0/gergo/svn_llvm/llvm/lib/CodeGen/RegAllocPBQP.cpp:604
#6  0x0000000000f40c11 in runOnMachineFunction (this=0x1af2920, MF=@0x1aca490)
    at /raid0/gergo/svn_llvm/llvm/lib/CodeGen/RegAllocPBQP.cpp:892
#7  0x0000000000ef14da in llvm::MachineFunctionPass::runOnFunction (
    this=0x1af2920, F=@0x1ac7b30)
    at /raid0/gergo/svn_llvm/llvm/lib/CodeGen/MachineFunctionPass.cpp:33
#8  0x00000000011e6ee1 in llvm::FPPassManager::runOnFunction (this=0x1ac4800, 
    F=@0x1ac7b30) at /raid0/gergo/svn_llvm/llvm/lib/VMCore/PassManager.cpp:1433
#9  0x00000000011e70b7 in llvm::FPPassManager::runOnModule (this=0x1ac4800, 
    M=@0x1ab6aa0) at /raid0/gergo/svn_llvm/llvm/lib/VMCore/PassManager.cpp:1453
#10 0x00000000011e6ba7 in llvm::MPPassManager::runOnModule (this=0x1ad41e0, 
    M=@0x1ab6aa0) at /raid0/gergo/svn_llvm/llvm/lib/VMCore/PassManager.cpp:1507
#11 0x00000000011e8343 in llvm::PassManagerImpl::run (this=0x1ac5890, 
    M=@0x1ab6aa0) at /raid0/gergo/svn_llvm/llvm/lib/VMCore/PassManager.cpp:1588
#12 0x00000000011e83a5 in llvm::PassManager::run (this=0x7fffffffe720, 
    M=@0x1ab6aa0) at /raid0/gergo/svn_llvm/llvm/lib/VMCore/PassManager.cpp:1631
#13 0x00000000009b06b0 in main (argc=3, argv=0x7fffffffe948)
    at /raid0/gergo/svn_llvm/llvm/tools/llc/llc.cpp:343

Apparently, some SlotIndex object does not have a valid index list entry.

The code is derived from the automotive-susan program in the Mibench benchmark
suite. Starting from susan.c from Mibench, the following commands were
performed:
clang -S -emit-llvm susan.c -o foo.ll
opt -mem2reg foo.ll -S -o foo_opt.ll
llvm-extract -func=edge_draw foo_opt.ll -o edge_draw.ll
llc -regalloc=pbqp edge_draw.ll

-- 
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