| Issue |
242426
|
| Summary |
[RISCV][P-ext] Unhandled register class for ValueType
|
| Labels |
backend:RISC-V,
crash-on-valid,
generated by fuzzer
|
| Assignees |
|
| Reporter |
XChy
|
Reproducer: https://godbolt.org/z/rY986v16z
Reduced case:
```c
#include <stdint.h>
typedef uint8_t v32u8 __attribute__((vector_size(32)));
union u0 {};
struct s2
{
};
uint16_t g10;
_Bool g30;
static void f2(uint64_t, union u0, struct s2, uint16_t, v32u8 a4, _Bool)
{
volatile uint32_t sf7;
lbl_f2_b12:
g30 = a4[sf7];
switch (g10)
case 2: goto lbl_f2_b12;
}
void main_c14()
{
uint64_t v6;
_Bool c19;
f2(v6, (union u0){}, (struct s2){}, 5, (v32u8){}, main_c14);
lbl_f1_b7:
if (c19) goto lbl_f1_b7;
}
```
This case crashed clang at `-O3 --target=riscv64 -menable-experimental-extensions -march=rv64gcp0p21`:
```
Unhandled register class for ValueType
UNREACHABLE executed at /root/llvm-project/llvm/lib/Target/RISCV/RISCVCallingConv.cpp:385!
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 -O3 --target=riscv64 -menable-experimental-extensions -march=rv64gcp0p21 <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 '@main_c14'
#0 0x0000000004f5da98 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4f5da98)
#1 0x0000000004f5acf4 llvm::sys::RunSignalHandlers() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4f5acf4)
#2 0x0000000004f5b32c llvm::sys::CleanupOnSignal(unsigned long) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4f5b32c)
#3 0x0000000004e94e78 CrashRecoverySignalHandler(int) CrashRecoveryContext.cpp:0:0
#4 0x00007fe110045330 (/lib/x86_64-linux-gnu/libc.so.6+0x45330)
#5 0x00007fe11009ec0c pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x9ec0c)
#6 0x00007fe11004527e raise (/lib/x86_64-linux-gnu/libc.so.6+0x4527e)
#7 0x00007fe1100288ff abort (/lib/x86_64-linux-gnu/libc.so.6+0x288ff)
#8 0x0000000004ea063a (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4ea063a)
#9 0x0000000003133c84 (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x3133c84)
#10 0x00000000031344b4 CC_RISCV_FastCC(unsigned int, llvm::MVT, llvm::MVT, llvm::CCValAssign::LocInfo, llvm::ISD::ArgFlagsTy, llvm::Type*, llvm::CCState&) (.isra.0) RISCVCallingConv.cpp:0:0
#11 0x00000000031378f8 llvm::CC_RISCV(unsigned int, llvm::MVT, llvm::MVT, llvm::CCValAssign::LocInfo, llvm::ISD::ArgFlagsTy, llvm::Type*, llvm::CCState&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x31378f8)
#12 0x000000000400e9b7 llvm::CCState::AnalyzeCallOperands(llvm::SmallVectorImpl<llvm::ISD::OutputArg> const&, bool (*)(unsigned int, llvm::MVT, llvm::MVT, llvm::CCValAssign::LocInfo, llvm::ISD::ArgFlagsTy, llvm::Type*, llvm::CCState&)) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x400e9b7)
#13 0x000000000323fb9e llvm::RISCVTargetLowering::LowerCall(llvm::TargetLowering::CallLoweringInfo&, llvm::SmallVectorImpl<llvm::SDValue>&) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x323fb9e)
#14 0x000000000676760c llvm::TargetLowering::LowerCallTo(llvm::TargetLowering::CallLoweringInfo&) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x676760c)
#15 0x000000000677385f llvm::SelectionDAGBuilder::lowerInvokable(llvm::TargetLowering::CallLoweringInfo&, llvm::BasicBlock const*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x677385f)
#16 0x000000000678c48e llvm::SelectionDAGBuilder::LowerCallTo(llvm::CallBase const&, llvm::SDValue, bool, bool, llvm::BasicBlock const*, llvm::TargetLowering::PtrAuthInfo const*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x678c48e)
#17 0x00000000067a3488 llvm::SelectionDAGBuilder::visitCall(llvm::CallInst const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x67a3488)
#18 0x00000000067b7519 llvm::SelectionDAGBuilder::visit(llvm::Instruction const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x67b7519)
#19 0x000000000685235d llvm::SelectionDAGISel::SelectBasicBlock(llvm::ilist_iterator_w_bits<llvm::ilist_detail::node_options<llvm::Instruction, true, false, void, true, llvm::BasicBlock>, false, true>, llvm::ilist_iterator_w_bits<llvm::ilist_detail::node_options<llvm::Instruction, true, false, void, true, llvm::BasicBlock>, false, true>, bool&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x685235d)
#20 0x00000000068531e6 llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x68531e6)
#21 0x000000000685488c llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x685488c)
#22 0x000000000683d0fe llvm::SelectionDAGISelLegacy::runOnMachineFunction(llvm::MachineFunction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x683d0fe)
#23 0x00000000041a34cf llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (.part.0) MachineFunctionPass.cpp:0:0
#24 0x00000000048040b3 llvm::FPPassManager::runOnFunction(llvm::Function&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x48040b3)
#25 0x00000000048044f1 llvm::FPPassManager::runOnModule(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x48044f1)
#26 0x0000000004804eb9 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4804eb9)
#27 0x00000000063b7c68 runCodeGenPipelineLegacy(llvm::TargetMachine&, llvm::Module&, llvm::raw_pwrite_stream&, llvm::raw_pwrite_stream*, llvm::CodeGenFileType, bool, llvm::ModuleSummaryIndex const*, bool) RunCodeGen.cpp:0:0
#28 0x00000000063b7e38 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+0x63b7e38)
#29 0x000000000538f470 (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
#30 0x000000000538fa3f 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+0x538fa3f)
#31 0x0000000005a5eb05 clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x5a5eb05)
#32 0x0000000009028c6c clang::ParseAST(clang::Sema&, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x9028c6c)
#33 0x0000000005a5ee98 clang::CodeGenAction::ExecuteAction() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x5a5ee98)
#34 0x0000000005d89d88 clang::FrontendAction::Execute() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x5d89d88)
#35 0x0000000005d164fd clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x5d164fd)
#36 0x0000000005e60ca3 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x5e60ca3)
#37 0x000000000171d7f8 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x171d7f8)
#38 0x00000000017146fa ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&, llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>) driver.cpp:0:0
#39 0x0000000001714883 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
#40 0x0000000005ad8679 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
#41 0x0000000004e95274 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4e95274)
#42 0x0000000005ad91e5 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
#43 0x0000000005a96002 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x5a96002)
#44 0x0000000005a992bc 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+0x5a992bc)
#45 0x0000000005aa57b5 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x5aa57b5)
#46 0x0000000001719e4a clang_main(int, char**, llvm::ToolContext const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x1719e4a)
#47 0x00000000016a0803 main (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x16a0803)
#48 0x00007fe11002a1ca (/lib/x86_64-linux-gnu/libc.so.6+0x2a1ca)
#49 0x00007fe11002a28b __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2a28b)
#50 0x00000000017140a5 _start (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x17140a5)
clang: error: clang frontend command failed due to signal (use -v to see invocation)
Program terminated with signal SIGABRT (6)
Compiler returned: 134
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs