Skip to content

[RegBankSelect] Assertion `N < NumContainedTys && "Element number out of range!"' #92062

Closed
@dianqk

Description

@dianqk

I tried the following code:

target triple = "arm64"

@p = external global { {}, { ptr } }

define void @foo() {
bb:
  %i1 = load ptr, ptr @p, align 8
  store ptr %i1, ptr null, align 8
  ret void
}

When using llc in LLVM 18, the following error occurs:

llc: /root/llvm-project/llvm/include/llvm/IR/DerivedTypes.h:343: llvm::Type* llvm::StructType::getElementType(unsigned int) const: Assertion `N < NumContainedTys && "Element number out of range!"' failed.
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-assertions-trunk/bin/llc -o /app/output.s -x86-asm-syntax=intel -O0 <source>
1.	Running pass 'Function Pass Manager' on module '<source>'.
2.	Running pass 'RegBankSelect' on function '@foo'
...
 #8 0x0000000000b27667 llvm::AArch64RegisterBankInfo::isLoadFromFPType(llvm::MachineInstr const&) const (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0xb27667)
 #9 0x0000000000b2b155 llvm::AArch64RegisterBankInfo::getInstrMapping(llvm::MachineInstr const&) const (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0xb2b155)
#10 0x0000000004203f47 llvm::RegBankSelect::assignInstr(llvm::MachineInstr&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x4203f47)
#11 0x00000000042044d3 llvm::RegBankSelect::assignRegisterBanks(llvm::MachineFunction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x42044d3)
...
Compiler returned: 139

https://llvm.godbolt.org/z/a4h1abfKc

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions