Issue 177866
Summary [AArch64] Assertion `NodeB && "B must be in the tree"' failed.
Labels backend:AArch64, crash-on-valid, generated by fuzzer
Assignees
Reporter XChy
    Reproducer: https://godbolt.org/z/aTMh7dhfM
Testcase:
```llvm
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32"
target triple = "aarch64-unknown-linux-musl"

define void @func_44(i1 %tobool3.not, ptr %g_530) {
entry:
  br label %for.cond2.outer

for.cond2.outer:                                  ; preds = %for.inc, %entry
  %add23.ph = phi i8 [ 0, %for.inc ], [ 0, %entry ]
  br label %for.cond2

for.cond2:                                        ; preds = %cleanup12.split, %for.cond2, %for.cond2.outer
  %load = load volatile i32, ptr null, align 4
  br i1 %tobool3.not, label %if.end, label %for.cond2

if.end:                                           ; preds = %for.cond2
  %tobool7.not = icmp eq i64 0, 0
  br i1 %tobool7.not, label %for.inc, label %cleanup12.split

for.inc: ; preds = %if.end
  %add = or i8 %add23.ph, 0
  br label %for.cond2.outer

cleanup12.split:                                  ; preds = %if.end
  store i64 0, ptr %g_530, align 8
  br label %for.cond2
}
```

Dump:
```
llc: /root/llvm-project/llvm/include/llvm/Support/GenericDomTree.h:558: NodeT* llvm::DominatorTreeBase<NodeT, IsPostDom>::findNearestCommonDominator(NodeT*, NodeT*) const [with NodeT = llvm::MachineBasicBlock; bool IsPostDom = false]: Assertion `NodeB && "B must be in the tree"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace and instructions to reproduce the bug.
Stack dump:
0.	Program arguments: /opt/compiler-explorer/clang-assertions-trunk/bin/llc -o /app/output.s -x86-asm-syntax=intel <source>
1.	Running pass 'Function Pass Manager' on module '<source>'.
2.	Running pass 'Shrink Wrapping analysis' on function '@func_44'
 #0 0x0000000004252e38 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x4252e38)
 #1 0x000000000424fd14 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
 #2 0x00007c9a0d042520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #3 0x00007c9a0d0969fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
 #4 0x00007c9a0d042476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
 #5 0x00007c9a0d0287f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
 #6 0x00007c9a0d02871b (/lib/x86_64-linux-gnu/libc.so.6+0x2871b)
 #7 0x00007c9a0d039e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
 #8 0x00000000033ec7f8 llvm::MachineBasicBlock* llvm::DominatorTreeBase<llvm::MachineBasicBlock, false>::findNearestCommonDominator<llvm::MachineBasicBlock**>(llvm::iterator_range<llvm::MachineBasicBlock**>) const (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x33ec7f8)
 #9 0x00000000033ef347 (anonymous namespace)::ShrinkWrapImpl::updateSaveRestorePoints(llvm::MachineBasicBlock&, llvm::RegScavenger*) ShrinkWrap.cpp:0:0
#10 0x00000000033f0033 (anonymous namespace)::ShrinkWrapImpl::performShrinkWrapping(llvm::ReversePostOrderTraversal<llvm::MachineBasicBlock*, llvm::GraphTraits<llvm::MachineBasicBlock*>> const&, llvm::RegScavenger*) ShrinkWrap.cpp:0:0
#11 0x00000000033f4428 (anonymous namespace)::ShrinkWrapImpl::run(llvm::MachineFunction&) ShrinkWrap.cpp:0:0
#12 0x00000000033f61a1 (anonymous namespace)::ShrinkWrapLegacy::runOnMachineFunction(llvm::MachineFunction&) (.part.0) ShrinkWrap.cpp:0:0
#13 0x000000000310b3f9 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (.part.0) MachineFunctionPass.cpp:0:0
#14 0x0000000003768236 llvm::FPPassManager::runOnFunction(llvm::Function&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3768236)
#15 0x00000000037685e1 llvm::FPPassManager::runOnModule(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x37685e1)
#16 0x0000000003768e4f llvm::legacy::PassManagerImpl::run(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3768e4f)
#17 0x00000000008ea142 compileModule(char**, llvm::SmallVectorImpl<llvm::PassPlugin>&, llvm::LLVMContext&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&) llc.cpp:0:0
#18 0x00000000007c591c main (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x7c591c)
#19 0x00007c9a0d029d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#20 0x00007c9a0d029e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#21 0x00000000008df1e5 _start (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x8df1e5)
Program terminated with signal: SIGSEGV
Compiler returned: 139
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to