[llvm] Fix an assert failure with a funclet in a swifttailcc function. (PR #78806)

Hiroshi Yamauchi via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 19 15:30:46 PST 2024


hjyamauchi wrote:

The assert failure dump looks like

```# | Assertion failed: (Subtarget.isCallingConvWin64(MF.getFunction().getCallingConv()) ) && "Funclets should only be present on Win64 or swifttailcc", file C:\Users\hiroshi\llvm-project\llvm\lib\Target\AArch64\AArch64FrameLowering.cpp, line 2596
# | PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
# | Stack dump:
# | 0.  Program arguments: c:\\users\\hiroshi\\llvm-project\\build\\bin\\llc.exe -o -
# | 1.  Running pass 'Function Pass Manager' on module '<stdin>'.
# | 2.  Running pass 'Live DEBUG_VALUE analysis' on function '@foo'
# | Exception Code: 0x80000003
# |  #0 0x00007ff7c1f8a3f5 HandleAbort C:\Users\hiroshi\llvm-project\llvm\lib\Support\Windows\Signals.inc:424:0
# |  #1 0x00007ffe39b3e5f5 (C:\Windows\System32\ucrtbase.dll+0x7e5f5)
# |  #2 0x00007ffe39b3f601 (C:\Windows\System32\ucrtbase.dll+0x7f601)
# |  #3 0x00007ffe39b40fae (C:\Windows\System32\ucrtbase.dll+0x80fae)
# |  #4 0x00007ffe39b411f1 (C:\Windows\System32\ucrtbase.dll+0x811f1)
# |  #5 0x00007ff7befa0f86 llvm::AArch64FrameLowering::resolveFrameOffsetReference(class llvm::MachineFunction const &, __int64, bool, bool, class llvm::Register &, bool, bool) const C:\Users\hiroshi\llvm-project\llvm\lib\Target\AArch64\AArch64FrameLowering.cpp:2598:0
# |  #6 0x00007ff7befa0b5d llvm::AArch64FrameLowering::resolveFrameIndexReference(class llvm::MachineFunction const &, int, class llvm::Register &, bool, bool) const C:\Users\hiroshi\llvm-project\llvm\lib\Target\AArch64\AArch64FrameLowering.cpp:2522:0
# |  #7 0x00007ff7bef9a131 llvm::AArch64FrameLowering::getFrameIndexReference(class llvm::MachineFunction const &, int, class llvm::Register &) const C:\Users\hiroshi\llvm-project\llvm\lib\Target\AArch64\AArch64FrameLowering.cpp:2474:0
# |  #8 0x00007ff7c1518934 `anonymous namespace'::VarLocBasedLDV::extractSpillBaseRegAndOffset C:\Users\hiroshi\llvm-project\llvm\lib\CodeGen\LiveDebugValues\VarLocBasedImpl.cpp:1303:0
# |  #9 0x00007ff7c1525b38 `anonymous-namespace'::VarLocBasedLDV::OpenRangesSet::getSpillVarLocs C:\Users\hiroshi\llvm-project\llvm\lib\CodeGen\LiveDebugValues\VarLocBasedImpl.cpp:962:0
# | #10 0x00007ff7c1525b38 `anonymous namespace'::VarLocBasedLDV::transferSpillOrRestoreInst C:\Users\hiroshi\llvm-project\llvm\lib\CodeGen\LiveDebugValues\VarLocBasedImpl.cpp:1761:0
# | #11 0x00007ff7c151095d llvm::PointerIntPairInfo<llvm::ilist_node_base<1> *,1,llvm::PointerLikeTypeTraits<llvm::ilist_node_base<1> *> >::getInt C:\Users\hiroshi\llvm-project\llvm\include\llvm\ADT\PointerIntPair.h:196:0
# | #12 0x00007ff7c151095d llvm::PointerIntPair<llvm::ilist_node_base<1> *,1,unsigned int,llvm::PointerLikeTypeTraits<llvm::ilist_node_base<1> *>,llvm::PointerIntPairInfo<llvm::ilist_node_base<1> *,1,llvm::PointerLikeTypeTraits<llvm::ilist_node_base<1> *> > >::getInt C:\Users\hiroshi\llvm-project\llvm\include\llvm\ADT\PointerIntPair.h:96:0
# | #13 0x00007ff7c151095d llvm::ilist_node_base<1>::isSentinel C:\Users\hiroshi\llvm-project\llvm\include\llvm\ADT\ilist_node_base.h:45:0
# | #14 0x00007ff7c151095d llvm::ilist_node_impl<llvm::ilist_detail::node_options<llvm::MachineInstr,1,1,void,0> >::isSentinel C:\Users\hiroshi\llvm-project\llvm\include\llvm\ADT\ilist_node.h:130:0
# | #15 0x00007ff7c151095d llvm::ilist_iterator<llvm::ilist_detail::node_options<llvm::MachineInstr,1,1,void,0>,0,0>::isEnd C:\Users\hiroshi\llvm-project\llvm\include\llvm\ADT\ilist_iterator.h:175:0
# | #16 0x00007ff7c151095d llvm::MachineInstrBundleIteratorHelper<0>::getBundleFinal C:\Users\hiroshi\llvm-project\llvm\include\llvm\CodeGen\MachineInstrBundleIterator.h:62:0
# | #17 0x00007ff7c151095d llvm::MachineInstrBundleIteratorHelper<0>::increment C:\Users\hiroshi\llvm-project\llvm\include\llvm\CodeGen\MachineInstrBundleIterator.h:70:0
# | #18 0x00007ff7c151095d llvm::MachineInstrBundleIterator<llvm::MachineInstr,0>::operator++ C:\Users\hiroshi\llvm-project\llvm\include\llvm\CodeGen\MachineInstrBundleIterator.h:260:0
# | #19 0x00007ff7c151095d `anonymous namespace'::VarLocBasedLDV::ExtendRanges C:\Users\hiroshi\llvm-project\llvm\lib\CodeGen\LiveDebugValues\VarLocBasedImpl.cpp:2344:0
# | #20 0x00007ff7c12cf58b `anonymous namespace'::LiveDebugValues::runOnMachineFunction C:\Users\hiroshi\llvm-project\llvm\lib\CodeGen\LiveDebugValues\LiveDebugValues.cpp:129:0
# | #21 0x00007ff7c108f822 llvm::MachineFunctionPass::runOnFunction(class llvm::Function &) C:\Users\hiroshi\llvm-project\llvm\lib\CodeGen\MachineFunctionPass.cpp:95:0# | #22 0x00007ff7c15ae120 llvm::FPPassManager::runOnFunction(class llvm::Function &) C:\Users\hiroshi\llvm-project\llvm\lib\IR\LegacyPassManager.cpp:1443:0
```

https://github.com/llvm/llvm-project/pull/78806


More information about the llvm-commits mailing list