| Issue |
242679
|
| Summary |
[RISCV][P-ext] Assertion `isSimple() && "Expected a SimpleValueType!"' failed.
|
| Labels |
backend:RISC-V,
crash-on-valid,
generated by fuzzer
|
| Assignees |
XChy
|
| Reporter |
XChy
|
Reproducer: https://godbolt.org/z/GWE56fqhY
Reduced case:
```c
#include <stdint.h>
typedef uint8_t v2u8 __attribute__((vector_size(2)));
union u1 {
v2u8 f1;
uint64_t f4
};
uint64_t g12;
_Bool g21;
void f3()
{
union u1 a3;
volatile uint32_t v8;
uint64_t bc19;
lbl_f3_b0:
if (g21) g12 = bc19 = -bc19;
if (v8) goto lbl_f3_b0;
bc19 = a3.f4;
a3.f1;
}
```
This case crashed clang at `-O1 --target=riscv64 -menable-experimental-extensions -march=rv64gcp0p21`:
```
clang: /root/llvm-project/llvm/include/llvm/CodeGen/ValueTypes.h:355: llvm::MVT llvm::EVT::getSimpleVT() const: Assertion `isSimple() && "Expected a SimpleValueType!"' failed.
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 -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 '@f3'
#0 0x0000000004f69b28 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4f69b28)
#1 0x0000000004f66d84 llvm::sys::RunSignalHandlers() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4f66d84)
#2 0x0000000004f673bc llvm::sys::CleanupOnSignal(unsigned long) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4f673bc)
#3 0x0000000004ea0f08 CrashRecoverySignalHandler(int) CrashRecoveryContext.cpp:0:0
#4 0x000079e4f8a45330 (/lib/x86_64-linux-gnu/libc.so.6+0x45330)
#5 0x000079e4f8a9ec0c pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x9ec0c)
#6 0x000079e4f8a4527e raise (/lib/x86_64-linux-gnu/libc.so.6+0x4527e)
#7 0x000079e4f8a288ff abort (/lib/x86_64-linux-gnu/libc.so.6+0x288ff)
#8 0x000079e4f8a2881b (/lib/x86_64-linux-gnu/libc.so.6+0x2881b)
#9 0x000079e4f8a3b517 (/lib/x86_64-linux-gnu/libc.so.6+0x3b517)
#10 0x0000000003251174 (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x3251174)
#11 0x000000000326747a llvm::RISCVTargetLowering::PerformDAGCombine(llvm::SDNode*, llvm::TargetLowering::DAGCombinerInfo&) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x326747a)
#12 0x000000000670a95b (anonymous namespace)::DAGCombiner::combine(llvm::SDNode*) DAGCombiner.cpp:0:0
#13 0x000000000670c792 llvm::SelectionDAG::Combine(llvm::CombineLevel, llvm::BatchAAResults*, llvm::CodeGenOptLevel) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x670c792)
#14 0x0000000006857fd9 llvm::SelectionDAGISel::CodeGenAndEmitDAG() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x6857fd9)
#15 0x000000000685c156 llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x685c156)
#16 0x000000000685d7fc llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x685d7fc)
#17 0x0000000006845f4e llvm::SelectionDAGISelLegacy::runOnMachineFunction(llvm::MachineFunction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x6845f4e)
#18 0x00000000041abbdf llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (.part.0) MachineFunctionPass.cpp:0:0
#19 0x000000000480ef33 llvm::FPPassManager::runOnFunction(llvm::Function&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x480ef33)
#20 0x000000000480f371 llvm::FPPassManager::runOnModule(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x480f371)
#21 0x000000000480fd39 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x480fd39)
#22 0x00000000063bf948 runCodeGenPipelineLegacy(llvm::TargetMachine&, llvm::Module&, llvm::raw_pwrite_stream&, llvm::raw_pwrite_stream*, llvm::CodeGenFileType, bool, llvm::ModuleSummaryIndex const*, bool) RunCodeGen.cpp:0:0
#23 0x00000000063bfb18 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+0x63bfb18)
#24 0x0000000005396130 (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
#25 0x00000000053966ff 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+0x53966ff)
#26 0x0000000005a65c15 clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x5a65c15)
#27 0x00000000090379dc clang::ParseAST(clang::Sema&, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x90379dc)
#28 0x0000000005a65fa8 clang::CodeGenAction::ExecuteAction() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x5a65fa8)
#29 0x0000000005d90cb8 clang::FrontendAction::Execute() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x5d90cb8)
#30 0x0000000005d1d42d clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x5d1d42d)
#31 0x0000000005e67bd3 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x5e67bd3)
#32 0x000000000171db38 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x171db38)
#33 0x0000000001714a3a ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&, llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>) driver.cpp:0:0
#34 0x0000000001714bc3 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
#35 0x0000000005adf639 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
#36 0x0000000004ea1304 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4ea1304)
#37 0x0000000005ae01a5 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
#38 0x0000000005a9cfc2 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x5a9cfc2)
#39 0x0000000005aa027c 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+0x5aa027c)
#40 0x0000000005aac775 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x5aac775)
#41 0x000000000171a18a clang_main(int, char**, llvm::ToolContext const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x171a18a)
#42 0x00000000016a0b03 main (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x16a0b03)
#43 0x000079e4f8a2a1ca (/lib/x86_64-linux-gnu/libc.so.6+0x2a1ca)
#44 0x000079e4f8a2a28b __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2a28b)
#45 0x00000000017143e5 _start (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x17143e5)
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