Skip to content

llc crashes on function definitions with label parameters #136144

@wangtz0607

Description

@wangtz0607

Example

define void @test(label %0) {
1:
    ret void
}

Actual Behavior

PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.	Program arguments: /opt/compiler-explorer/clang-trunk/bin/llc -o /app/output.s -x86-asm-syntax=intel <source>
1.	Running pass 'Function Pass Manager' on module '<source>'.
2.	Running pass 'X86 DAG->DAG Instruction Selection' on function '@test'
 #0 0x0000000003acc698 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-trunk/bin/llc+0x3acc698)
 #1 0x0000000003aca254 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
 #2 0x0000735660842520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #3 0x0000000002ffc46b llvm::DataLayout::getABITypeAlign(llvm::Type*) const (/opt/compiler-explorer/clang-trunk/bin/llc+0x2ffc46b)
 #4 0x00000000037c91ab llvm::SelectionDAGISel::LowerArguments(llvm::Function const&) (/opt/compiler-explorer/clang-trunk/bin/llc+0x37c91ab)
 #5 0x00000000038858ca llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) (/opt/compiler-explorer/clang-trunk/bin/llc+0x38858ca)
 #6 0x0000000003886676 llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) (/opt/compiler-explorer/clang-trunk/bin/llc+0x3886676)
 #7 0x0000000003873171 llvm::SelectionDAGISelLegacy::runOnMachineFunction(llvm::MachineFunction&) (/opt/compiler-explorer/clang-trunk/bin/llc+0x3873171)
 #8 0x0000000002b4b018 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (.part.0) MachineFunctionPass.cpp:0:0
 #9 0x00000000030c5ff2 llvm::FPPassManager::runOnFunction(llvm::Function&) (/opt/compiler-explorer/clang-trunk/bin/llc+0x30c5ff2)
#10 0x00000000030c6281 llvm::FPPassManager::runOnModule(llvm::Module&) (/opt/compiler-explorer/clang-trunk/bin/llc+0x30c6281)
#11 0x00000000030c7be9 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/opt/compiler-explorer/clang-trunk/bin/llc+0x30c7be9)
#12 0x00000000008b937f compileModule(char**, llvm::LLVMContext&) llc.cpp:0:0
#13 0x0000000000795efe main (/opt/compiler-explorer/clang-trunk/bin/llc+0x795efe)
#14 0x0000735660829d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#15 0x0000735660829e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#16 0x00000000008b0e45 _start (/opt/compiler-explorer/clang-trunk/bin/llc+0x8b0e45)

Godbolt

Expected Behavior

The program should be rejected.

Environment

LLVM trunk on x86_64 Linux.

Metadata

Metadata

Assignees

Labels

crashPrefer [crash-on-valid] or [crash-on-invalid]llvm:ir

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions