Issue 108936
Summary [X86-backend] Unsupported library call operation!
Labels new issue
Assignees
Reporter DigOrDog
    # Description
The following code crashes X86 backend with "LLVM ERROR: Unsupported library call operation!"

# Minimal Reproduction
https://godbolt.org/

## code
```
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"

define i32 @main(x86_fp80 %0) {
 %CastFPTrunc = fptrunc x86_fp80 %0 to bfloat
  store bfloat %CastFPTrunc, ptr null, align 2
  unreachable
}
```

## Stack Trace
```
LLVM ERROR: Unsupported library call operation!
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-trunk/bin/llc -o /app/output.s -x86-asm-syntax=intel -mtriple=x86_64 -O=2 <source>
1.	Running pass 'Function Pass Manager' on module '<source>'.
2.	Running pass 'X86 DAG->DAG Instruction Selection' on function '@main'
 #0 0x000000000385d588 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-trunk/bin/llc+0x385d588)
 #1 0x000000000385af2c SignalHandler(int) Signals.cpp:0:0
 #2 0x00007c30b8842520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #3 0x00007c30b88969fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
 #4 0x00007c30b8842476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
 #5 0x00007c30b88287f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
 #6 0x000000000074b35c llvm::UniqueStringSaver::save(llvm::Twine const&) (.cold) StringSaver.cpp:0:0
 #7 0x00000000037b48c8 (/opt/compiler-explorer/clang-trunk/bin/llc+0x37b48c8)
 #8 0x0000000003688dc7 llvm::TargetLowering::makeLibCall(llvm::SelectionDAG&, llvm::RTLIB::Libcall, llvm::EVT, llvm::ArrayRef<llvm::SDValue>, llvm::TargetLowering::MakeLibCallOptions, llvm::SDLoc const&, llvm::SDValue) const (/opt/compiler-explorer/clang-trunk/bin/llc+0x3688dc7)
 #9 0x0000000001d6619e llvm::X86TargetLowering::LowerFP_TO_BF16(llvm::SDValue, llvm::SelectionDAG&) const (/opt/compiler-explorer/clang-trunk/bin/llc+0x1d6619e)
#10 0x0000000001e52034 llvm::X86TargetLowering::LowerOperation(llvm::SDValue, llvm::SelectionDAG&) const (/opt/compiler-explorer/clang-trunk/bin/llc+0x1e52034)
#11 0x000000000351fd25 (anonymous namespace)::SelectionDAGLegalize::LegalizeOp(llvm::SDNode*) LegalizeDAG.cpp:0:0
#12 0x00000000035244be llvm::SelectionDAG::Legalize() (/opt/compiler-explorer/clang-trunk/bin/llc+0x35244be)
#13 0x000000000362057b llvm::SelectionDAGISel::CodeGenAndEmitDAG() (/opt/compiler-explorer/clang-trunk/bin/llc+0x362057b)
#14 0x000000000362316c llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) (/opt/compiler-explorer/clang-trunk/bin/llc+0x362316c)
#15 0x0000000003624dcf llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) (/opt/compiler-explorer/clang-trunk/bin/llc+0x3624dcf)
#16 0x0000000003610ff1 llvm::SelectionDAGISelLegacy::runOnMachineFunction(llvm::MachineFunction&) (/opt/compiler-explorer/clang-trunk/bin/llc+0x3610ff1)
#17 0x00000000029195fb llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (.part.0) MachineFunctionPass.cpp:0:0
#18 0x0000000002e64ff2 llvm::FPPassManager::runOnFunction(llvm::Function&) (/opt/compiler-explorer/clang-trunk/bin/llc+0x2e64ff2)
#19 0x0000000002e65281 llvm::FPPassManager::runOnModule(llvm::Module&) (/opt/compiler-explorer/clang-trunk/bin/llc+0x2e65281)
#20 0x0000000002e66c26 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/opt/compiler-explorer/clang-trunk/bin/llc+0x2e66c26)
#21 0x000000000086e124 compileModule(char**, llvm::LLVMContext&) llc.cpp:0:0
#22 0x000000000075f416 main (/opt/compiler-explorer/clang-trunk/bin/llc+0x75f416)
#23 0x00007c30b8829d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#24 0x00007c30b8829e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#25 0x0000000000865efe _start (/opt/compiler-explorer/clang-trunk/bin/llc+0x865efe)
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