Issue 208746
Summary Bad machine code: Virtual register defs don't dominate all uses.
Labels crash-on-valid
Assignees
Reporter TatyanaDoubts
    *** Bad machine code: Virtual register defs don't dominate all uses. ***
- function:    widget
- v. register: %19
LLVM ERROR: Found 1 machine code errors.

To reproduce run llc (assertions trunk) with the test 
[reduced-stripped.ll.zip](https://github.com/user-attachments/files/29894313/reduced-stripped.ll.zip)

Reproducer: https://godbolt.org/z/T7qb68oEf

Stack dump:
```
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 'Live Interval Analysis' on function '@widget'
 #0 0x0000000004405148 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x4405148)
 #1 0x0000000004402004 llvm::sys::RunSignalHandlers() (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x4402004)
 #2 0x000000000440217a SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
 #3 0x00007de36c645330 (/lib/x86_64-linux-gnu/libc.so.6+0x45330)
 #4 0x00007de36c69eb2c pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x9eb2c)
 #5 0x00007de36c64527e raise (/lib/x86_64-linux-gnu/libc.so.6+0x4527e)
 #6 0x00007de36c6288ff abort (/lib/x86_64-linux-gnu/libc.so.6+0x288ff)
 #7 0x00000000007d1b06 llvm::json::operator==(llvm::json::Value const&, llvm::json::Value const&) (.cold) JSON.cpp:0:0
 #8 0x00000000032cab8c (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x32cab8c)
 #9 0x00000000032e35a5 llvm::MachineFunction::verify(llvm::Pass*, char const*, llvm::raw_ostream*, bool) const (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x32e35a5)
#10 0x000000000310aeb8 llvm::LiveRangeCalc::findReachingDefs(llvm::LiveRange&, llvm::MachineBasicBlock&, llvm::SlotIndex, llvm::Register, llvm::ArrayRef<llvm::SlotIndex>) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x310aeb8)
#11 0x000000000310bd9e llvm::LiveRangeCalc::extend(llvm::LiveRange&, llvm::SlotIndex, llvm::Register, llvm::ArrayRef<llvm::SlotIndex>) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x310bd9e)
#12 0x000000000310c974 llvm::LiveIntervalCalc::extendToUses(llvm::LiveRange&, llvm::Register, llvm::LaneBitmask, llvm::LiveInterval*) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x310c974)
#13 0x000000000310d626 llvm::LiveIntervalCalc::calculate(llvm::LiveInterval&, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x310d626)
#14 0x00000000030f2160 llvm::LiveIntervals::computeVirtRegInterval(llvm::LiveInterval&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x30f2160)
#15 0x00000000030f48e3 llvm::LiveIntervals::computeVirtRegs() (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x30f48e3)
#16 0x00000000030f4c1f llvm::LiveIntervals::analyze(llvm::MachineFunction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x30f4c1f)
#17 0x00000000030f4fe9 llvm::LiveIntervalsWrapperPass::runOnMachineFunction(llvm::MachineFunction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x30f4fe9)
#18 0x00000000031b418d llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (.part.0) MachineFunctionPass.cpp:0:0
#19 0x00000000037eca31 llvm::FPPassManager::runOnFunction(llvm::Function&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x37eca31)
#20 0x00000000037ecf61 llvm::FPPassManager::runOnModule(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x37ecf61)
#21 0x00000000037ed921 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x37ed921)
#22 0x000000000089f391 compileModule(char**, llvm::SmallVectorImpl<llvm::PassPlugin>&, llvm::LLVMContext&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&) llc.cpp:0:0
#23 0x00000000007d5abc main (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x7d5abc)
#24 0x00007de36c62a1ca (/lib/x86_64-linux-gnu/libc.so.6+0x2a1ca)
#25 0x00007de36c62a28b __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2a28b)
#26 0x0000000000894305 _start (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x894305)
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