[llvm-bugs] [Bug 43718] New: Assertion `BasePtr == FramePtr && "Expected the FP as base register"' failed.

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Oct 18 16:27:02 PDT 2019


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

            Bug ID: 43718
           Summary: Assertion `BasePtr == FramePtr && "Expected the FP as
                    base register"' failed.
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: X86
          Assignee: unassignedbugs at nondot.org
          Reporter: nick at wasmer.io
                CC: craig.topper at gmail.com, llvm-bugs at lists.llvm.org,
                    llvm-dev at redking.me.uk, spatel+llvm at rotateright.com

Setting code model to large and enabling AVX trigger a crash in the
"Prologue/Epilogue Insertion & Frame Finalization" backend pass.

$ llc -code-model=large -mattr=+avx b.ll
llc: /home/nick/llvm-upstream/llvm/lib/Target/X86/X86RegisterInfo.cpp:763:
virtual void
llvm::X86RegisterInfo::eliminateFrameIndex(llvm::MachineBasicBlock::iterator,
int, unsigned int, llvm::RegScavenger*) const: Assertion `BasePtr == FramePtr
&& "Expected the FP as base register"' failed.
Stack dump:
0.      Program arguments: llvm-upstream/build/bin/llc -code-model=large
-mattr=+avx b.ll 
1.      Running pass 'Function Pass Manager' on module 'b.ll'.
2.      Running pass 'Prologue/Epilogue Insertion & Frame Finalization' on
function '@fn1774'
 #0 0x000055b7fcc5e4a0 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
/home/nick/llvm-upstream/llvm/lib/Support/Unix/Signals.inc:532:22
 #1 0x000055b7fcc5e533 PrintStackTraceSignalHandler(void*)
/home/nick/llvm-upstream/llvm/lib/Support/Unix/Signals.inc:593:1
 #2 0x000055b7fcc5c6d8 llvm::sys::RunSignalHandlers()
/home/nick/llvm-upstream/llvm/lib/Support/Signals.cpp:68:20
 #3 0x000055b7fcc5df1d SignalHandler(int)
/home/nick/llvm-upstream/llvm/lib/Support/Unix/Signals.inc:384:1
 #4 0x00007ff88e555510 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x13510)
 #5 0x00007ff88e030081 raise (/lib/x86_64-linux-gnu/libc.so.6+0x3a081)
 #6 0x00007ff88e01b535 abort (/lib/x86_64-linux-gnu/libc.so.6+0x25535)
 #7 0x00007ff88e01b40f (/lib/x86_64-linux-gnu/libc.so.6+0x2540f)
 #8 0x00007ff88e028b92 (/lib/x86_64-linux-gnu/libc.so.6+0x32b92)
 #9 0x000055b7fb52dee4
llvm::X86RegisterInfo::eliminateFrameIndex(llvm::MachineInstrBundleIterator<llvm::MachineInstr,
false>, int, unsigned int, llvm::RegScavenger*) const
/home/nick/llvm-upstream/llvm/lib/Target/X86/X86RegisterInfo.cpp:764:52
#10 0x000055b7fc01c540 (anonymous
namespace)::PEI::replaceFrameIndices(llvm::MachineBasicBlock*,
llvm::MachineFunction&, int&)
/home/nick/llvm-upstream/llvm/lib/CodeGen/PrologEpilogInserter.cpp:1279:7
#11 0x000055b7fc01bca2 (anonymous
namespace)::PEI::replaceFrameIndices(llvm::MachineFunction&)
/home/nick/llvm-upstream/llvm/lib/CodeGen/PrologEpilogInserter.cpp:1161:26
#12 0x000055b7fc01832d (anonymous
namespace)::PEI::runOnMachineFunction(llvm::MachineFunction&)
/home/nick/llvm-upstream/llvm/lib/CodeGen/PrologEpilogInserter.cpp:269:41
#13 0x000055b7fbe675c0
llvm::MachineFunctionPass::runOnFunction(llvm::Function&)
/home/nick/llvm-upstream/llvm/lib/CodeGen/MachineFunctionPass.cpp:73:33
#14 0x000055b7fc379547 llvm::FPPassManager::runOnFunction(llvm::Function&)
/home/nick/llvm-upstream/llvm/lib/IR/LegacyPassManager.cpp:1648:20
#15 0x000055b7fc3797ac llvm::FPPassManager::runOnModule(llvm::Module&)
/home/nick/llvm-upstream/llvm/lib/IR/LegacyPassManager.cpp:1684:13
#16 0x000055b7fc379bd6 (anonymous
namespace)::MPPassManager::runOnModule(llvm::Module&)
/home/nick/llvm-upstream/llvm/lib/IR/LegacyPassManager.cpp:1749:20
#17 0x000055b7fc37a338 llvm::legacy::PassManagerImpl::run(llvm::Module&)
/home/nick/llvm-upstream/llvm/lib/IR/LegacyPassManager.cpp:1862:13
#18 0x000055b7fc37a535 llvm::legacy::PassManager::run(llvm::Module&)
/home/nick/llvm-upstream/llvm/lib/IR/LegacyPassManager.cpp:1894:1
#19 0x000055b7fb4b7486 compileModule(char**, llvm::LLVMContext&)
/home/nick/llvm-upstream/llvm/tools/llc/llc.cpp:605:66
#20 0x000055b7fb4b5bff main
/home/nick/llvm-upstream/llvm/tools/llc/llc.cpp:355:35
#21 0x00007ff88e01cbbb __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x26bbb)
#22 0x000055b7fb4b402a _start (llvm-upstream/build/bin/llc+0x2ea702a)

The same b.ll file is a big strange, but this is the shortest I could get:

; ModuleID = 'b.bc'
source_filename = "module"
target triple = "x86_64-unknown-linux-gnu"

declare void @llvm.experimental.stackmap(i64, i32, ...)

define void @fn1774(i8* %0, i64 %base160) {
entry:
  %local9 = alloca i32, align 4
  call void (i64, i32, ...) @llvm.experimental.stackmap(i64 3280, i32 0, i32*
nonnull %local9)
  %s188 = add i64 0, %base160
  %s190 = add i64 %s188, 24
  %s191 = inttoptr i64 %s190 to i64*
  store i64 -99999, i64* %s191, align 4
  %s194 = add i64 0, %base160
  %s196 = add i64 %s194, 32
  %s197 = inttoptr i64 %s196 to i64*
  store i64 -99999, i64* %s197, align 4
  %s200 = add i64 0, %base160
  %s202 = add i64 %s200, 40
  %s203 = inttoptr i64 %s202 to i64*
  store i64 -99999, i64* %s203, align 4
  %s206 = add i64 0, %base160
  %s208 = add i64 %s206, 48
  %s209 = inttoptr i64 %s208 to i64*
  store i64 0, i64* %s209, align 4
  %s236 = call i32 undef(i8* nonnull %0)
  %s262 = add i64 0, %base160
  %s264 = add i64 %s262, 24
  %s265 = inttoptr i64 %s264 to i64*
  store i64 -99999, i64* %s265, align 4
  %s268 = add i64 0, %base160
  %s270 = add i64 %s268, 32
  %s271 = inttoptr i64 %s270 to i64*
  store i64 -99999, i64* %s271, align 4
  %s274 = add i64 0, %base160
  %s276 = add i64 %s274, 40
  %s277 = inttoptr i64 %s276 to i64*
  store i64 -99999, i64* %s277, align 4
  %s280 = add i64 0, %base160
  %s282 = add i64 %s280, 48
  %s283 = inttoptr i64 %s282 to i64*
  store i64 0, i64* %s283, align 4
  unreachable
}

-- 
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/20191018/669eee7d/attachment-0001.html>


More information about the llvm-bugs mailing list