| Issue |
242268
|
| Summary |
[RISCV][P-ext] Cannot select: t228: v2i32 = zero_extend_vector_inreg t69
|
| Labels |
backend:RISC-V,
crash-on-valid,
generated by fuzzer
|
| Assignees |
|
| Reporter |
XChy
|
Reproducer: https://godbolt.org/z/89TsndW59
Reduced case:
```c
#include <riscv_packed_simd.h>
typedef uint8_t v128u8 __attribute__((vector_size(128)));
v128u8 g10;
_Bool g19;
uint8_t f5()
{
v128u8 as4;
void *p5;
goto lbl_f5_b25;
lbl_f5_b8:
*(uint16_t *)p5 = 7;
lbl_f5_b25:
if (g19) goto lbl_f5_b8;
p5 = &as4;
g10 = __builtin_shufflevector(
as4, as4, 8, 3, 5, 3, 5, 3, 9, 0, 2, 3, 5, 6, 3, 4, 9, 0, 5, 232, 144,
3, 177, 1, 4, 155, 3, 0, 3, 43, 6, 109, 0, 1, 4, 0, 7, 1, 1, 6, 8, 6, 0,
1, 3, 3, 8, 7, 7, 7, 1, 4, 2, 0, 5, 1, 0, 0, 2, 2, 6, 9, 8, 6, 5, 1, 1,
7, 0, 4, 5, 6, 1, 0, 3, 7, 0, 109, 2, 0, 7, 5, 2, 1, 8, 8, 1, 0, 4, 4,
8, 1, 6, 6, 0, 1, 1, 2, 3, 8, 108, 2, 1, 5, 9, 2, 5, 3, 6, 6, 4, 2, 2,
1, 4, 5, 9, 5, 3, 7, 6, 4, 9, 3, 3, 8, 6, 0, 4, 8);
goto lbl_f5_b8;
}
```
This case crashed clang with `--target=riscv64 -menable-experimental-extensions -march=rv64i_p0p21`:
```
fatal error: error in backend: Cannot select: t228: v2i32 = zero_extend_vector_inreg t69, example.c:15:11
t69: v8i8,ch = load<(dereferenceable load (s64) from %ir.as4 + 48, align 16, basealign 128)> t5, t224, poison:i64, example.c:16:9
t224: i64 = or disjoint FrameIndex:i64<0>, Constant:i64<48>, example.c:16:9
In function: f5
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 --target=riscv64 -menable-experimental-extensions -march=rv64i_p0p21 <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 '@f5'
#0 0x0000000004f4f778 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4f4f778)
#1 0x0000000004f4c9d4 llvm::sys::RunSignalHandlers() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4f4c9d4)
#2 0x0000000004f4d00c llvm::sys::CleanupOnSignal(unsigned long) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4f4d00c)
#3 0x0000000004e871e6 llvm::CrashRecoveryContext::HandleExit(int) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4e871e6)
#4 0x0000000004f4457e llvm::sys::Process::Exit(int, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4f4457e)
#5 0x00000000017152a0 LLVMErrorHandler(void*, char const*, bool) cc1_main.cpp:0:0
#6 0x0000000004e920f3 llvm::report_fatal_error(llvm::Twine const&, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4e920f3)
#7 0x000000000682ede9 llvm::SelectionDAGISel::CannotYetSelect(llvm::SDNode*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x682ede9)
#8 0x000000000683951d llvm::SelectionDAGISel::SelectCodeCommon(llvm::SDNode*, unsigned char const*, unsigned int, unsigned char const*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x683951d)
#9 0x0000000003190b4b llvm::RISCVDAGToDAGISel::Select(llvm::SDNode*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x3190b4b)
#10 0x0000000006831f64 llvm::SelectionDAGISel::DoInstructionSelection() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x6831f64)
#11 0x000000000683fc68 llvm::SelectionDAGISel::CodeGenAndEmitDAG() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x683fc68)
#12 0x0000000006843456 llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x6843456)
#13 0x0000000006844afc llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x6844afc)
#14 0x000000000682d36e llvm::SelectionDAGISelLegacy::runOnMachineFunction(llvm::MachineFunction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x682d36e)
#15 0x0000000004195c7f llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (.part.0) MachineFunctionPass.cpp:0:0
#16 0x00000000047f7143 llvm::FPPassManager::runOnFunction(llvm::Function&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x47f7143)
#17 0x00000000047f7581 llvm::FPPassManager::runOnModule(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x47f7581)
#18 0x00000000047f7f49 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x47f7f49)
#19 0x00000000063a7cd8 runCodeGenPipelineLegacy(llvm::TargetMachine&, llvm::Module&, llvm::raw_pwrite_stream&, llvm::raw_pwrite_stream*, llvm::CodeGenFileType, bool, llvm::ModuleSummaryIndex const*, bool) RunCodeGen.cpp:0:0
#20 0x00000000063a7ea8 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+0x63a7ea8)
#21 0x0000000005381b60 (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
#22 0x000000000538212f 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+0x538212f)
#23 0x0000000005a4f9c5 clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x5a4f9c5)
#24 0x0000000009008c8c clang::ParseAST(clang::Sema&, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x9008c8c)
#25 0x0000000005a4fd58 clang::CodeGenAction::ExecuteAction() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x5a4fd58)
#26 0x0000000005d7a7c8 clang::FrontendAction::Execute() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x5d7a7c8)
#27 0x0000000005d0737d clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x5d0737d)
#28 0x0000000005e51043 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x5e51043)
#29 0x0000000001717968 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x1717968)
#30 0x000000000170e86a ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&, llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>) driver.cpp:0:0
#31 0x000000000170e9f3 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
#32 0x0000000005ac9539 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
#33 0x0000000004e87124 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4e87124)
#34 0x0000000005aca0a5 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
#35 0x0000000005a86ec2 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x5a86ec2)
#36 0x0000000005a8a17c 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+0x5a8a17c)
#37 0x0000000005a96675 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x5a96675)
#38 0x0000000001713fba clang_main(int, char**, llvm::ToolContext const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x1713fba)
#39 0x000000000169a073 main (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x169a073)
#40 0x0000790e6f02a1ca (/lib/x86_64-linux-gnu/libc.so.6+0x2a1ca)
#41 0x0000790e6f02a28b __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2a28b)
#42 0x000000000170e215 _start (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x170e215)
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