Skip to content

SPARC backend crashes when emitting dwarf debug information from dbg_value #9368

@llvmbot

Description

@llvmbot
Bugzilla Link 8996
Resolution FIXED
Resolved on Oct 26, 2011 14:48
Version trunk
OS Solaris
Attachments testcase
Reporter LLVM Bugzilla Contributor

Extended Description

When generating code for the attached file, SPARC backend crashes. (See below) The crash occurs because DwarfDebug::addVariableAddress calls TFI->getFrameIndexReference() with the immediate value from a DBG_VALUE instruction. But the frame index is already eliminated by the PEI pass.

llc -march=sparc test/CodeGen/SPARC/bugpoint-reduced-simplified.ll

llc: ../llvm/include/llvm/CodeGen/MachineFrameInfo.h:373: int64_t llvm::MachineFrameInfo::getObjectOffset(int) const: Assertion `unsigned(ObjectIdx+NumFixedObjects) < Objects.size() && "Invalid Object Idx!"' failed.
1 llc 0x000000000133fb0c
2 libpthread.so.0 0x000000344bc0eb10
3 libc.so.6 0x000000344b030265 gsignal + 53
4 libc.so.6 0x000000344b031d10 abort + 272
5 libc.so.6 0x000000344b0296e6 __assert_fail + 246
6 llc 0x0000000000a0b608 llvm::MachineFrameInfo::getObjectOffset(int) const + 94
7 llc 0x00000000011af86d llvm::TargetFrameLowering::getFrameIndexOffset(llvm::MachineFunction const&, int) const + 45
8 llc 0x00000000011af722 llvm::TargetFrameLowering::getFrameIndexReference(llvm::MachineFunction const&, int, unsigned int&) const + 112
9 llc 0x0000000000ebdf2d llvm::DwarfDebug::addVariableAddress(llvm::DbgVariable*&, llvm::DIE*, long) + 113
10 llc 0x0000000000ebe546 llvm::DwarfDebug::constructVariableDIE(llvm::DbgVariable*, llvm::DbgScope*) + 1424
11 llc 0x0000000000ebe99e llvm::DwarfDebug::constructScopeDIE(llvm::DbgScope*) + 604
12 llc 0x0000000000ebea02 llvm::DwarfDebug::constructScopeDIE(llvm::DbgScope*) + 704
13 llc 0x0000000000ebee64 llvm::DwarfDebug::endFunction(llvm::MachineFunction const*) + 972
14 llc 0x0000000000eab6a4 llvm::AsmPrinter::EmitFunctionBody() + 2080
15 llc 0x0000000000a082e1 llvm::AsmPrinter::runOnMachineFunction(llvm::MachineFunction&) + 47
16 llc 0x0000000000f41e8b llvm::MachineFunctionPass::runOnFunction(llvm::Function&) + 85
17 llc 0x0000000001279ce2 llvm::FPPassManager::runOnFunction(llvm::Function&) + 350
18 llc 0x0000000001279eb7 llvm::FPPassManager::runOnModule(llvm::Module&) + 81
19 llc 0x00000000012799a3 llvm::MPPassManager::runOnModule(llvm::Module&) + 381
20 llc 0x000000000127b133 llvm::PassManagerImpl::run(llvm::Module&) + 111
21 llc 0x000000000127b195 llvm::PassManager::run(llvm::Module&) + 33
22 llc 0x00000000009970e7 main + 2201
23 libc.so.6 0x000000344b01d994 __libc_start_main + 244
24 llc 0x0000000000995949
Stack dump:
0. Program arguments: llc -march=sparc

  1.  Running pass 'Function Pass Manager' on module '<stdin>'.
    
  2.  Running pass 'Sparc Assembly Printer' on function '@CheckReliabilityOfRef'
    

Aborted

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzilla

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions