Skip to content

virtual bool llvm::X86RegisterInfo::eliminateFrameIndex(llvm::MachineBasicBlock::iterator, int, unsigned int, llvm::RegScavenger*) const: Assertion `(!Is64Bit || isInt<32>((long long)FIOffset + Imm)) && "Requesting 64-bit offset in 32-bit immediate!"' failed. #87154

Closed
@DigOrDog

Description

@DigOrDog

Description

The following code crashes X86 backend with "Assertion `(!Is64Bit || isInt<32>((long long)FIOffset + Imm)) && "Requesting 64-bit offset in 32-bit immediate!"' failed."

Minimal Reproduction

https://godbolt.org/z/h57r6bMsq

code

define void @f(i16 %LGV2, i1 %LGV3) {
BB:
  %A = alloca i1, i33 2147483648, align 1
  %G = getelementptr i1, ptr %A, i16 %LGV2
  %G4 = getelementptr i1, ptr %G, i32 -2147483648
  store i1 %LGV3, ptr %G4, align 1
  ret void
}

Stack Trace

llc: /root/llvm-project/llvm/lib/Target/X86/X86RegisterInfo.cpp:950: virtual bool llvm::X86RegisterInfo::eliminateFrameIndex(llvm::MachineBasicBlock::iterator, int, unsigned int, llvm::RegScavenger*) const: Assertion `(!Is64Bit || isInt<32>((long long)FIOffset + Imm)) && "Requesting 64-bit offset in 32-bit immediate!"' 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 -mtriple=x86_64 -mattr=+avx512f -O=0 <source>
1.	Running pass 'Function Pass Manager' on module '<source>'.
2.	Running pass 'Prologue/Epilogue Insertion & Frame Finalization' on function '@f'
 #0 0x000000000392d5d8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x392d5d8)
 #1 0x000000000392ad2c SignalHandler(int) Signals.cpp:0:0
 #2 0x00007f2edc842520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #3 0x00007f2edc8969fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
 #4 0x00007f2edc842476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
 #5 0x00007f2edc8287f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
 #6 0x00007f2edc82871b (/lib/x86_64-linux-gnu/libc.so.6+0x2871b)
 #7 0x00007f2edc839e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
 #8 0x0000000001cf0fb0 llvm::X86RegisterInfo::eliminateFrameIndex(llvm::MachineInstrBundleIterator<llvm::MachineInstr, false>, int, unsigned int, llvm::RegScavenger*) const (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x1cf0fb0)
 #9 0x0000000002ac734c (anonymous namespace)::PEI::runOnMachineFunction(llvm::MachineFunction&) PrologEpilogInserter.cpp:0:0
#10 0x0000000002946051 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (.part.0) MachineFunctionPass.cpp:0:0
#11 0x0000000002f04a33 llvm::FPPassManager::runOnFunction(llvm::Function&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x2f04a33)
#12 0x0000000002f04c71 llvm::FPPassManager::runOnModule(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x2f04c71)
#13 0x0000000002f054d5 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x2f054d5)
#14 0x0000000000823e0c compileModule(char**, llvm::LLVMContext&) llc.cpp:0:0
#15 0x0000000000722fd6 main (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x722fd6)
#16 0x00007f2edc829d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#17 0x00007f2edc829e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#18 0x000000000081a92e _start (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x81a92e)
Program terminated with signal: SIGSEGV
Compiler returned: 139

Metadata

Metadata

Assignees

No one assigned

    Labels

    backend:X86crashPrefer [crash-on-valid] or [crash-on-invalid]

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions