Closed
Description
Description
The following code crashes aarch64 backend with "Unknown FP condition!"
Minimal Reproduction
https://godbolt.org/z/7EeccGP3r
Code
; ModuleID = 'crash-4f3ab3a32f91d152361bae65ffeca42d2fa3e7b9'
source_filename = "M"
define float @f(i1 %0, i16 %1) {
BB:
%RP = alloca float, align 4
br label %BB2
BB2: ; preds = %BB2, %BB
%C2 = fcmp true float 4.200000e+01, 4.200000e+01
%B2 = and i1 %C2, %0
%2 = load float, ptr %RP, align 4
br i1 %B2, label %BB2, label %BB1
BB1: ; preds = %BB2
ret float %2
}
Stack Trace
Unknown FP condition!
UNREACHABLE executed at /root/llvm-project/llvm/lib/Target/AArch64/GISel/AArch64GlobalISelUtils.cpp:105!
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0. Program arguments: /opt/compiler-explorer/clang-assertions-trunk/bin/llc -o /app/output.s -x86-asm-syntax=intel -mtriple=aarch64 -O=0 <source>
1. Running pass 'Function Pass Manager' on module '<source>'.
2. Running pass 'InstructionSelect' on function '@f'
#0 0x0000000003928f08 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3928f08)
#1 0x000000000392665c SignalHandler(int) Signals.cpp:0:0
#2 0x00007f2211a42520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
#3 0x00007f2211a969fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
#4 0x00007f2211a42476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
#5 0x00007f2211a287f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
#6 0x000000000387521a (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x387521a)
#7 0x0000000000cc2500 llvm::AArch64GISelUtils::changeVectorFCMPPredToAArch64CC(llvm::CmpInst::Predicate, llvm::AArch64CC::CondCode&, llvm::AArch64CC::CondCode&, bool&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0xcc2500)
#8 0x0000000000a8af3c (anonymous namespace)::AArch64InstructionSelector::selectCompareBranch(llvm::MachineInstr&, llvm::MachineFunction&, llvm::MachineRegisterInfo&) (.isra.0) AArch64InstructionSelector.cpp:0:0
#9 0x0000000000a9085d (anonymous namespace)::AArch64InstructionSelector::select(llvm::MachineInstr&) AArch64InstructionSelector.cpp:0:0
#10 0x00000000040d02a9 llvm::InstructionSelect::runOnMachineFunction(llvm::MachineFunction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x40d02a9)
#11 0x0000000002942d31 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (.part.0) MachineFunctionPass.cpp:0:0
#12 0x0000000002f01813 llvm::FPPassManager::runOnFunction(llvm::Function&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x2f01813)
#13 0x0000000002f01a51 llvm::FPPassManager::runOnModule(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x2f01a51)
#14 0x0000000002f022b5 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x2f022b5)
#15 0x000000000082323c compileModule(char**, llvm::LLVMContext&) llc.cpp:0:0
#16 0x00000000007223e6 main (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x7223e6)
#17 0x00007f2211a29d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#18 0x00007f2211a29e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#19 0x0000000000819d5e _start (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x819d5e)
Program terminated with signal: SIGSEGV
Compiler returned: 139