[LLVMbugs] [Bug 23463] New: Old LLVM IR file causing assertion `cast<DISubprogram>(Scope)->describes(MF->getFunction())' to fail

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri May 8 17:46:31 PDT 2015


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

            Bug ID: 23463
           Summary: Old LLVM IR file causing assertion
                    `cast<DISubprogram>(Scope)->describes(MF->getFunction(
                    ))' to fail
           Product: tools
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: llc
          Assignee: unassignedbugs at nondot.org
          Reporter: douglas_yung at playstation.sony.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

While upgrading some internal tests we have to work with a newer version of
LLVM, I came across one of our tests which started causing an assertion failure
when fed to a more modern version of llc. The version of llc I used to
reproduce the issue was built from r236913 on x64 linux.

While the compiler no longer produces this IR, it should still accept or reject
it without crashing.

Repro produced by bugpoint:
=====
; ModuleID = 'bugpoint-reduced-simplified.bc'
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

; Function Attrs: nounwind sspstrong uwtable
define void @_Z3barv() #0 {
entry:
  call void @llvm.trap(), !dbg !15
  unreachable
}

; Function Attrs: noreturn nounwind
declare void @llvm.trap() #1

attributes #0 = { nounwind sspstrong uwtable "less-precise-fpmad"="false"
"no-frame-pointer-elim"="false" "no-frame-pointer-elim-non-leaf"
"no-infs-fp-math"="false" "no-nans-fp-math"="false"
"stack-protector-buffer-size"="8" "target-cpu"="btver2"
"unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #1 = { noreturn nounwind }

!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!11, !12, !13}
!llvm.ident = !{!14}

!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang
version 3.7.0", isOptimized: false, runtimeVersion: 0, emissionKind: 1, enums:
!2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2)
!1 = !DIFile(filename: "dbg-inline-scope.cpp", directory: "")
!2 = !{}
!3 = !{!4, !8}
!4 = !DISubprogram(name: "foo", linkageName: "_Z3fooii", scope: !1, file: !1,
line: 2, type: !5, isLocal: false, isDefinition: true, scopeLine: 2, flags:
DIFlagPrototyped, isOptimized: false, variables: !2)
!5 = !DISubroutineType(types: !6)
!6 = !{!7, !7, !7}
!7 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
!8 = !DISubprogram(name: "bar", linkageName: "_Z3barv", scope: !1, file: !1,
line: 6, type: !9, isLocal: false, isDefinition: true, scopeLine: 6, flags:
DIFlagPrototyped, isOptimized: false, function: void ()* @_Z3barv, variables:
!2)
!9 = !DISubroutineType(types: !10)
!10 = !{!7}
!11 = !{i32 2, !"Dwarf Version", i32 4}
!12 = !{i32 2, !"Debug Info Version", i32 3}
!13 = !{i32 1, !"PIC Level", i32 2}
!14 = !{!"clang version 3.7.0"}
!15 = !DILocation(line: 3, scope: !4)
=====

Failure command: llc repro.ll

Failure stack trace:
llc: /home/dyung/llvm/llvm/lib/CodeGen/LexicalScopes.cpp:160:
llvm::LexicalScope* llvm::LexicalScopes::getOrCreateRegularScope(const
llvm::DILocalScope*): Assertion
`cast<DISubprogram>(Scope)->describes(MF->getFunction())' failed.
#0 0x22867ed llvm::sys::PrintStackTrace(llvm::raw_ostream&)
/home/dyung/llvm/llvm/lib/Support/Unix/Signals.inc:437:0
#1 0x2286b41 PrintStackTraceSignalHandler(void*)
/home/dyung/llvm/llvm/lib/Support/Unix/Signals.inc:495:0
#2 0x22854de SignalHandler(int)
/home/dyung/llvm/llvm/lib/Support/Unix/Signals.inc:210:0
#3 0x7fe9a1186c90 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0xfc90)
#4 0x7fe9a03b9e37 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x36e37)
#5 0x7fe9a03bb528 abort (/lib/x86_64-linux-gnu/libc.so.6+0x38528)
#6 0x7fe9a03b2ce6 (/lib/x86_64-linux-gnu/libc.so.6+0x2fce6)
#7 0x7fe9a03b2d92 (/lib/x86_64-linux-gnu/libc.so.6+0x2fd92)
#8 0x19b89a0 llvm::LexicalScopes::getOrCreateRegularScope(llvm::DILocalScope
const*) /home/dyung/llvm/llvm/lib/CodeGen/LexicalScopes.cpp:161:0
#9 0x19b87ae llvm::LexicalScopes::getOrCreateLexicalScope(llvm::DILocalScope
const*, llvm::DILocation const*)
/home/dyung/llvm/llvm/lib/CodeGen/LexicalScopes.cpp:138:0
#10 0x19b80be llvm::LexicalScopes::getOrCreateLexicalScope(llvm::DILocation
const*) /home/dyung/llvm/llvm/include/llvm/CodeGen/LexicalScopes.h:209:0
#11 0x19b84a2
llvm::LexicalScopes::extractLexicalScopes(llvm::SmallVectorImpl<std::pair<llvm::MachineInstr
const*, llvm::MachineInstr const*> >&, llvm::DenseMap<llvm::MachineInstr
const*, llvm::LexicalScope*, llvm::DenseMapInfo<llvm::MachineInstr const*>,
llvm::detail::DenseMapPair<llvm::MachineInstr const*, llvm::LexicalScope*> >&)
/home/dyung/llvm/llvm/lib/CodeGen/LexicalScopes.cpp:102:0
#12 0x19b81b5 llvm::LexicalScopes::initialize(llvm::MachineFunction const&)
/home/dyung/llvm/llvm/lib/CodeGen/LexicalScopes.cpp:46:0
#13 0x19c0c4d (anonymous
namespace)::LDVImpl::runOnMachineFunction(llvm::MachineFunction&)
/home/dyung/llvm/llvm/lib/CodeGen/LiveDebugVariables.cpp:741:0
#14 0x19c0f28
llvm::LiveDebugVariables::runOnMachineFunction(llvm::MachineFunction&)
/home/dyung/llvm/llvm/lib/CodeGen/LiveDebugVariables.cpp:773:0
#15 0x1a3f5d3 llvm::MachineFunctionPass::runOnFunction(llvm::Function&)
/home/dyung/llvm/llvm/lib/CodeGen/MachineFunctionPass.cpp:41:0
#16 0x21be9fb llvm::FPPassManager::runOnFunction(llvm::Function&)
/home/dyung/llvm/llvm/lib/IR/LegacyPassManager.cpp:1537:0
#17 0x21beb8d llvm::FPPassManager::runOnModule(llvm::Module&)
/home/dyung/llvm/llvm/lib/IR/LegacyPassManager.cpp:1557:0
#18 0x21beecf (anonymous namespace)::MPPassManager::runOnModule(llvm::Module&)
/home/dyung/llvm/llvm/lib/IR/LegacyPassManager.cpp:1615:0
#19 0x21bf592 llvm::legacy::PassManagerImpl::run(llvm::Module&)
/home/dyung/llvm/llvm/lib/IR/LegacyPassManager.cpp:1722:0
#20 0x21bf7b3 llvm::legacy::PassManager::run(llvm::Module&)
/home/dyung/llvm/llvm/lib/IR/LegacyPassManager.cpp:1756:0
#21 0xc4ab33 compileModule(char**, llvm::LLVMContext&)
/home/dyung/llvm/llvm/tools/llc/llc.cpp:356:0
#22 0xc49c5c main /home/dyung/llvm/llvm/tools/llc/llc.cpp:201:0
#23 0x7fe9a03a4ec5 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21ec5)
#24 0xc46d19 _start
(/home/dyung/llvm/llvm/build/Debug+Asserts/bin/llc+0xc46d19)
Stack dump:
0.    Program arguments: llc repro.ll 
1.    Running pass 'Function Pass Manager' on module 'repro.ll'.
2.    Running pass 'Debug Variable Analysis' on function '@_Z3barv'

-- 
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/20150509/4edb898d/attachment.html>


More information about the llvm-bugs mailing list