| Issue |
242983
|
| Summary |
[RISCV][P-ext] invalid node: operand #1 must have type i64, but has type i8
|
| Labels |
backend:RISC-V,
crash-on-valid,
generated by fuzzer
|
| Assignees |
|
| Reporter |
XChy
|
Reproducer: https://godbolt.org/z/bGjYqGvGE
Reduced case:
```c
#include <stdint.h>
typedef uint8_t v128u8 __attribute__((vector_size(8)));
const v128u8 g22 = { 10015223221612816425,
10812365061410802440,
4038251187714530,
60229500242100148,
40,
9074006103236181,
100239 };
v128u8 f4_vec16;
void f4()
{
f4_vec16 = f4_vec16 << g22;
f4_vec16 = f4_vec16 << f4_vec16;
}
```
This case crashed clang at `-O1 --target=riscv64 -march=rv64gcp0p21 -menable-experimental-extensions`:
```
fatal error: error in backend: invalid node: operand #1 must have type i64, but has type i8
t54: v8i8 = RISCVISD::PSLL t53, t51, example.c:14:25
t53: v8i8 = BUILD_VECTOR undef:i8, undef:i8, undef:i8, undef:i8, undef:i8, undef:i8, undef:i8, t51, example.c:13:25
t51: i8 = extract_vector_elt t4, Constant:i64<7>, example.c:13:25
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace and dumped files.
Stack dump:
0. Program arguments: /opt/compiler-explorer/clang-assertions-trunk/bin/clang -g -o /app/output.s -mllvm --x86-asm-syntax=intel -fno-verbose-asm -S --gcc-toolchain=/opt/compiler-explorer/gcc-snapshot -fcolor-diagnostics -fno-crash-diagnostics -O1 --target=riscv64 -march=rv64gcp0p21 -menable-experimental-extensions <source>
1. <eof> parser at end of file
2. Code generation
3. Running pass 'Function Pass Manager' on module '<source>'.
4. Running pass 'RISC-V DAG->DAG Pattern Instruction Selection' on function '@f4'
#0 0x0000000004f6a568 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4f6a568)
#1 0x0000000004f677c4 llvm::sys::RunSignalHandlers() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4f677c4)
#2 0x0000000004f67dfc llvm::sys::CleanupOnSignal(unsigned long) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4f67dfc)
#3 0x0000000004ea1de6 llvm::CrashRecoveryContext::HandleExit(int) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4ea1de6)
#4 0x0000000004f5f36e llvm::sys::Process::Exit(int, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4f5f36e)
#5 0x000000000171b630 LLVMErrorHandler(void*, char const*, bool) cc1_main.cpp:0:0
#6 0x0000000004eaccf3 llvm::report_fatal_error(llvm::Twine const&, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4eaccf3)
#7 0x0000000004eace27 (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4eace27)
#8 0x0000000006757807 reportNodeError(llvm::SelectionDAG const&, llvm::SDNode const*, llvm::Twine const&) SDNodeInfo.cpp:0:0
#9 0x0000000006759aba llvm::SDNodeInfo::verifyNode(llvm::SelectionDAG const&, llvm::SDNode const*) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x6759aba)
#10 0x00000000032962e8 llvm::RISCVSelectionDAGInfo::verifyTargetNode(llvm::SelectionDAG const&, llvm::SDNode const*) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x32962e8)
#11 0x00000000067c6cb2 llvm::SelectionDAG::verifyNode(llvm::SDNode*) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x67c6cb2)
#12 0x00000000067c70db llvm::SelectionDAG::InsertNode(llvm::SDNode*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x67c70db)
#13 0x000000000680dfa1 llvm::SelectionDAG::getNode(unsigned int, llvm::SDLoc const&, llvm::EVT, llvm::SDValue, llvm::SDValue, llvm::SDNodeFlags) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x680dfa1)
#14 0x000000000325ce61 llvm::RISCVTargetLowering::LowerOperation(llvm::SDValue, llvm::SelectionDAG&) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x325ce61)
#15 0x000000000690bcbf (anonymous namespace)::VectorLegalizer::LegalizeOp(llvm::SDValue) LegalizeVectorOps.cpp:0:0
#16 0x000000000690cf17 llvm::SelectionDAG::LegalizeVectors() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x690cf17)
#17 0x0000000006859fe6 llvm::SelectionDAGISel::CodeGenAndEmitDAG() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x6859fe6)
#18 0x000000000685df16 llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x685df16)
#19 0x000000000685f5bc llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x685f5bc)
#20 0x0000000006847d0e llvm::SelectionDAGISelLegacy::runOnMachineFunction(llvm::MachineFunction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x6847d0e)
#21 0x00000000041acdbf llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (.part.0) MachineFunctionPass.cpp:0:0
#22 0x0000000004810053 llvm::FPPassManager::runOnFunction(llvm::Function&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4810053)
#23 0x0000000004810491 llvm::FPPassManager::runOnModule(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4810491)
#24 0x0000000004810e59 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4810e59)
#25 0x00000000063c12d8 runCodeGenPipelineLegacy(llvm::TargetMachine&, llvm::Module&, llvm::raw_pwrite_stream&, llvm::raw_pwrite_stream*, llvm::CodeGenFileType, bool, llvm::ModuleSummaryIndex const*, bool) RunCodeGen.cpp:0:0
#26 0x00000000063c14a8 llvm::runCodeGenPipeline(llvm::TargetMachine&, llvm::Module&, llvm::raw_pwrite_stream&, llvm::raw_pwrite_stream*, llvm::CodeGenFileType, bool, bool, llvm::ModuleSummaryIndex const*, llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x63c14a8)
#27 0x0000000005397250 (anonymous namespace)::EmitAssemblyHelper::emitAssembly(clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream>>, clang::BackendConsumer*) BackendUtil.cpp:0:0
#28 0x000000000539781f clang::emitBackendOutput(clang::CompilerInstance&, clang::CodeGenOptions&, llvm::Module*, clang::BackendAction, llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream>>, clang::BackendConsumer*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x539781f)
#29 0x0000000005a67025 clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x5a67025)
#30 0x0000000009039c3c clang::ParseAST(clang::Sema&, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x9039c3c)
#31 0x0000000005a673b8 clang::CodeGenAction::ExecuteAction() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x5a673b8)
#32 0x0000000005d92208 clang::FrontendAction::Execute() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x5d92208)
#33 0x0000000005d1e97d clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x5d1e97d)
#34 0x0000000005e69223 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x5e69223)
#35 0x000000000171dcf8 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x171dcf8)
#36 0x0000000001714bfa ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&, llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>) driver.cpp:0:0
#37 0x0000000001714d83 int llvm::function_ref<int (llvm::SmallVectorImpl<char const*>&)>::callback_fn<clang_main(int, char**, llvm::ToolContext const&)::'lambda'(llvm::SmallVectorImpl<char const*>&)>(long, llvm::SmallVectorImpl<char const*>&) driver.cpp:0:0
#38 0x0000000005ae0a49 void llvm::function_ref<void ()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const::'lambda'()>(long) Job.cpp:0:0
#39 0x0000000004ea1d24 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4ea1d24)
#40 0x0000000005ae15b5 clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const (.part.0) Job.cpp:0:0
#41 0x0000000005a9e3d2 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x5a9e3d2)
#42 0x0000000005aa168c clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&, bool) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x5aa168c)
#43 0x0000000005aadb85 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x5aadb85)
#44 0x000000000171a34a clang_main(int, char**, llvm::ToolContext const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x171a34a)
#45 0x00000000016a0d03 main (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x16a0d03)
#46 0x000070010ec2a1ca (/lib/x86_64-linux-gnu/libc.so.6+0x2a1ca)
#47 0x000070010ec2a28b __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2a28b)
#48 0x00000000017145a5 _start (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x17145a5)
clang: error: clang frontend command failed with exit code 70 (use -v to see invocation)
Compiler returned: 70
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs