Skip to content

[X86] Assertion failure: Range metadata and load type must match! #147781

@nikic

Description

@nikic
target triple = "i686-pc-windows-gnu"

define void @test(ptr %p, ptr %p2) #0 {
  %val = load i64, ptr %p, align 8, !range !0
  store i64 %val, ptr %p2, align 8
  ret void
}

attributes #0 = { "target-cpu"="pentium4" }

!0 = !{i64 1, i64 0}
llc: /home/npopov/repos/llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:9495: SDValue llvm::SelectionDAG::getLoad(ISD::MemIndexedMode, ISD::LoadExtType, EVT, const SDLoc &, SDValue, SDValue, SDValue, EVT, MachineMemOperand *): Assertion `(!MMO->getRanges() || (mdconst::extract<ConstantInt>(MMO->getRanges()->getOperand(0)) ->getBitWidth() == MemVT.getScalarSizeInBits() && MemVT.isInteger())) && "Range metadata and load type must match!"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.	Program arguments: build/bin/llc -debug
1.	Running pass 'Function Pass Manager' on module '<stdin>'.
2.	Running pass 'X86 DAG->DAG Instruction Selection' on function '@test'
 #0 0x0000000007480ce8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (build/bin/llc+0x7480ce8)
 #1 0x000000000747e3d5 llvm::sys::RunSignalHandlers() (build/bin/llc+0x747e3d5)
 #2 0x0000000007481a91 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
 #3 0x00007faf1d9fbc30 __restore_rt (/lib64/libc.so.6+0x19c30)
 #4 0x00007faf1da5511c __pthread_kill_implementation (/lib64/libc.so.6+0x7311c)
 #5 0x00007faf1d9fbafe gsignal (/lib64/libc.so.6+0x19afe)
 #6 0x00007faf1d9e36d0 abort (/lib64/libc.so.6+0x16d0)
 #7 0x00007faf1d9e3639 __assert_perror_fail (/lib64/libc.so.6+0x1639)
 #8 0x000000000723472c llvm::SelectionDAG::getLoad(llvm::ISD::MemIndexedMode, llvm::ISD::LoadExtType, llvm::EVT, llvm::SDLoc const&, llvm::SDValue, llvm::SDValue, llvm::SDValue, llvm::EVT, llvm::MachineMemOperand*) (build/bin/llc+0x723472c)
 #9 0x00000000072352cf llvm::SelectionDAG::getLoad(llvm::EVT, llvm::SDLoc const&, llvm::SDValue, llvm::SDValue, llvm::MachineMemOperand*) (build/bin/llc+0x72352cf)
#10 0x0000000005ae2d78 combineStore(llvm::SDNode*, llvm::SelectionDAG&, llvm::TargetLowering::DAGCombinerInfo&, llvm::X86Subtarget const&) X86ISelLowering.cpp:0:0
#11 0x0000000005abd1cc llvm::X86TargetLowering::PerformDAGCombine(llvm::SDNode*, llvm::TargetLowering::DAGCombinerInfo&) const X86ISelLowering.cpp:0:0
#12 0x0000000007066302 (anonymous namespace)::DAGCombiner::combine(llvm::SDNode*) DAGCombiner.cpp:0:0
#13 0x0000000007065046 llvm::SelectionDAG::Combine(llvm::CombineLevel, llvm::BatchAAResults*, llvm::CodeGenOptLevel) (build/bin/llc+0x7065046)

Metadata

Metadata

Assignees

Labels

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

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions