| Issue |
176637
|
| Summary |
[RISCV] Assertion `castIsValid(getOpcode(), S, Ty) && "Illegal ZExt"` failed for `fptosi fp128 ... to i96`
|
| Labels |
llvm:codegen,
crash-on-valid
|
| Assignees |
|
| Reporter |
alexrp
|
```llvm
target datalayout = "e-m:e-p:32:32-i64:64-n32-S128"
target triple = "riscv32-unknown-linux5.10.0-musl"
define i96 @__fixtfei(fp128 %0) {
Entry:
%1 = fptosi fp128 %0 to i96
ret i96 %1
}
```
```
❯ llc --version | head -n2
LLVM (http://llvm.org/):
LLVM version 22.1.0-rc1
❯ llc -O0 reduced.ll
llc: /home/alexrp/Sources/llvm/llvm/lib/IR/Instructions.cpp:3421: llvm::ZExtInst::ZExtInst(llvm::Value*, llvm::Type*, const llvm::Twine&, llvm::InsertPosition): Assertion `castIsValid(getOpcode(), S, Ty) && "Illegal ZExt"' 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: llc -O0 reduced.ll
1. Running pass 'Function Pass Manager' on module 'reduced.ll'.
2. Running pass 'Expand IR instructions' on function '@__fixtfei'
#0 0x00007c2048621d2d llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /home/alexrp/Sources/llvm/llvm/lib/Support/Unix/Signals.inc:846:3
#1 0x00007c204861ee64 llvm::sys::RunSignalHandlers() /home/alexrp/Sources/llvm/llvm/lib/Support/Signals.cpp:108:20
#2 0x00007c204861f67c SignalHandler(int, siginfo_t*, void*) /home/alexrp/Sources/llvm/llvm/lib/Support/Unix/Signals.inc:429:14
#3 0x00007c2046e45f60 (/lib/x86_64-linux-gnu/libc.so.6+0x45f60)
#4 0x00007c2046ea5fed __pthread_kill_implementation ./nptl/pthread_kill.c:44:76
#5 0x00007c2046ea5fed __pthread_kill_internal ./nptl/pthread_kill.c:89:10
#6 0x00007c2046ea5fed pthread_kill ./nptl/pthread_kill.c:100:10
#7 0x00007c2046e45e2e raise ./signal/../sysdeps/posix/raise.c:27:6
#8 0x00007c2046e28888 internal_signal_block_all ./stdlib/../sysdeps/unix/sysv/linux/internal-signals.h:81:3
#9 0x00007c2046e28888 __abort_lock_wrlock ./stdlib/abort.c:62:3
#10 0x00007c2046e28888 abort ./stdlib/abort.c:85:3
#11 0x00007c2046e287f0 __assert_perror_fail ./assert/assert-perr.c:31:1
#12 0x00007c2047edd9fd (/opt/llvm-22/bin/../lib/libLLVM.so.22.1-rc1+0x8dd9fd)
#13 0x00007c2048666f43 llvm::ZExtInst* llvm::IRBuilderBase::Insert<llvm::ZExtInst>(llvm::ZExtInst*, llvm::Twine const&) const /home/alexrp/Sources/llvm/llvm/include/llvm/IR/IRBuilder.h:173:5
#14 0x00007c2048666f43 llvm::IRBuilderBase::CreateZExt(llvm::Value*, llvm::Type*, llvm::Twine const&, bool) /home/alexrp/Sources/llvm/llvm/include/llvm/IR/IRBuilder.h:2091:28
#15 0x00007c2048a3dc5e expandFPToI(llvm::Instruction*) /home/alexrp/Sources/llvm/llvm/include/llvm/IR/IRBuilder.h:2356:68
#16 0x00007c2048a43949 llvm::SmallVectorBase<unsigned int>::empty() const /home/alexrp/Sources/llvm/llvm/include/llvm/ADT/SmallVector.h:83:46
#17 0x00007c2048a43949 runImpl(llvm::Function&, llvm::TargetLowering const&, llvm::LibcallLoweringInfo const&, llvm::AssumptionCache*) (.isra.0) /home/alexrp/Sources/llvm/llvm/lib/CodeGen/ExpandIRInsts.cpp:1091:25
#18 0x00007c20487dd52a llvm::FPPassManager::runOnFunction(llvm::Function&) /home/alexrp/Sources/llvm/llvm/lib/IR/LegacyPassManager.cpp:1398:40
#19 0x00007c20487dd735 llvm::ilist_detail::node_base_prevnext<llvm::ilist_node_base<true, void>, true>::getNext() const /home/alexrp/Sources/llvm/llvm/include/llvm/ADT/ilist_node_base.h:42:38
#20 0x00007c20487dd735 llvm::ilist_node_impl<llvm::ilist_detail::node_options<llvm::Function, true, false, void, false, void>>::getNext() /home/alexrp/Sources/llvm/llvm/include/llvm/ADT/ilist_node.h:108:66
#21 0x00007c20487dd735 llvm::ilist_iterator<llvm::ilist_detail::node_options<llvm::Function, true, false, void, false, void>, false, false>::operator++() /home/alexrp/Sources/llvm/llvm/include/llvm/ADT/ilist_iterator.h:187:25
#22 0x00007c20487dd735 llvm::FPPassManager::runOnModule(llvm::Module&) /home/alexrp/Sources/llvm/llvm/lib/IR/LegacyPassManager.cpp:1443:22
#23 0x00007c20487ddfcf runOnModule /home/alexrp/Sources/llvm/llvm/lib/IR/LegacyPassManager.cpp:1513:38
#24 0x00007c20487ddfcf llvm::legacy::PassManagerImpl::run(llvm::Module&) /home/alexrp/Sources/llvm/llvm/lib/IR/LegacyPassManager.cpp:531:55
#25 0x0000604b2cb4a9f5 compileModule(char**, llvm::SmallVectorImpl<llvm::PassPlugin>&, llvm::LLVMContext&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&) /home/alexrp/Sources/llvm/llvm/tools/llc/llc.cpp:874:34
#26 0x0000604b2cb3df5c main /home/alexrp/Sources/llvm/llvm/tools/llc/llc.cpp:462:35
#27 0x00007c2046e2a575 __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:74:3
#28 0x00007c2046e2a628 call_init ./csu/../csu/libc-start.c:128:20
#29 0x00007c2046e2a628 __libc_start_main ./csu/../csu/libc-start.c:347:5
#30 0x0000604b2cb3ece5 _start (/opt/llvm-22/bin/llc+0x15ce5)
fish: Job 1, 'llc -O0 reduced.ll' terminated by signal SIGABRT (Abort)
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs