-
Notifications
You must be signed in to change notification settings - Fork 15.4k
Closed
Labels
llvm:SelectionDAGSelectionDAGISel as wellSelectionDAGISel as well
Description
Testcase:
int a, c;
char b;
_Bool d[1];
int main() {
for (short e = 0; e < c; e += 4) {
a = d[e] ? 0 : 20;
b &= d[e];
}
}Flags: -march=rv64gcv_zvl256b -O3 -mrvv-vector-bits=zvl
Backtrace (from godbolt since mine didn't have the full backtrace):
fatal error: error in backend: Invalid size request on a scalable vector.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0. Program arguments: /opt/compiler-explorer/clang-trunk/bin/clang -g -o /app/output.s -S -target riscv64-unknown-linux-gnu -march=rv64gc -mabi=lp64d --gcc-toolchain=/opt/compiler-explorer/riscv64/gcc-8.2.0/riscv64-unknown-linux-gnu --sysroot=/opt/compiler-explorer/riscv64/gcc-8.2.0/riscv64-unknown-linux-gnu/riscv64-unknown-linux-gnu/sysroot -fcolor-diagnostics -fno-crash-diagnostics -march=rv64gcv_zvl256b -O2 -mrvv-vector-bits=zvl <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'
#0 0x00000000036ad1a8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-trunk/bin/clang+0x36ad1a8)
#1 0x00000000036ab2f4 llvm::sys::CleanupOnSignal(unsigned long) (/opt/compiler-explorer/clang-trunk/bin/clang+0x36ab2f4)
#2 0x00000000035f4373 llvm::CrashRecoveryContext::HandleExit(int) (/opt/compiler-explorer/clang-trunk/bin/clang+0x35f4373)
#3 0x00000000036a28de llvm::sys::Process::Exit(int, bool) (/opt/compiler-explorer/clang-trunk/bin/clang+0x36a28de)
#4 0x0000000000c4de16 (/opt/compiler-explorer/clang-trunk/bin/clang+0xc4de16)
#5 0x00000000035fd3c3 llvm::report_fatal_error(llvm::Twine const&, bool) (/opt/compiler-explorer/clang-trunk/bin/clang+0x35fd3c3)
#6 0x00000000035fd528 (/opt/compiler-explorer/clang-trunk/bin/clang+0x35fd528)
#7 0x000000000365129d (/opt/compiler-explorer/clang-trunk/bin/clang+0x365129d)
#8 0x00000000036512bc llvm::TypeSize::operator unsigned long() const (/opt/compiler-explorer/clang-trunk/bin/clang+0x36512bc)
#9 0x000000000487e9d8 llvm::DAGTypeLegalizer::SplitVecRes_BITCAST(llvm::SDNode*, llvm::SDValue&, llvm::SDValue&) (/opt/compiler-explorer/clang-trunk/bin/clang+0x487e9d8)
#10 0x000000000489d59d llvm::DAGTypeLegalizer::SplitVectorResult(llvm::SDNode*, unsigned int) (/opt/compiler-explorer/clang-trunk/bin/clang+0x489d59d)
#11 0x00000000048642ba llvm::DAGTypeLegalizer::run() (/opt/compiler-explorer/clang-trunk/bin/clang+0x48642ba)
#12 0x0000000004864971 llvm::SelectionDAG::LegalizeTypes() (/opt/compiler-explorer/clang-trunk/bin/clang+0x4864971)
#13 0x00000000047e6281 llvm::SelectionDAGISel::CodeGenAndEmitDAG() (/opt/compiler-explorer/clang-trunk/bin/clang+0x47e6281)
#14 0x00000000047e90c8 llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) (/opt/compiler-explorer/clang-trunk/bin/clang+0x47e90c8)
#15 0x00000000047eb8a9 llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) (.part.0) SelectionDAGISel.cpp:0:0
#16 0x0000000002b26cd0 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (.part.0) MachineFunctionPass.cpp:0:0
#17 0x0000000003066a12 llvm::FPPassManager::runOnFunction(llvm::Function&) (/opt/compiler-explorer/clang-trunk/bin/clang+0x3066a12)
#18 0x0000000003066b91 llvm::FPPassManager::runOnModule(llvm::Module&) (/opt/compiler-explorer/clang-trunk/bin/clang+0x3066b91)
#19 0x0000000003068840 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/opt/compiler-explorer/clang-trunk/bin/clang+0x3068840)
#20 0x000000000391f3de clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::HeaderSearchOptions const&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::StringRef, 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-trunk/bin/clang+0x391f3de)
#21 0x0000000003f15269 clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) (/opt/compiler-explorer/clang-trunk/bin/clang+0x3f15269)
#22 0x0000000005dca6ac clang::ParseAST(clang::Sema&, bool, bool) (/opt/compiler-explorer/clang-trunk/bin/clang+0x5dca6ac)
#23 0x0000000003f146c5 clang::CodeGenAction::ExecuteAction() (/opt/compiler-explorer/clang-trunk/bin/clang+0x3f146c5)
#24 0x00000000041aa421 clang::FrontendAction::Execute() (/opt/compiler-explorer/clang-trunk/bin/clang+0x41aa421)
#25 0x000000000412fdcb clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/compiler-explorer/clang-trunk/bin/clang+0x412fdcb)
#26 0x000000000428d863 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/compiler-explorer/clang-trunk/bin/clang+0x428d863)
#27 0x0000000000c4fc0c cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/compiler-explorer/clang-trunk/bin/clang+0xc4fc0c)
#28 0x0000000000c49bbd ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) driver.cpp:0:0
#29 0x0000000003f5d519 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
#30 0x00000000035f4273 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-trunk/bin/clang+0x35f4273)
#31 0x0000000003f5d739 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
#32 0x0000000003f23d17 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/opt/compiler-explorer/clang-trunk/bin/clang+0x3f23d17)
#33 0x0000000003f246cd clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&, bool) const (/opt/compiler-explorer/clang-trunk/bin/clang+0x3f246cd)
#34 0x0000000003f2e4bc clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/opt/compiler-explorer/clang-trunk/bin/clang+0x3f2e4bc)
#35 0x0000000000c4d071 clang_main(int, char**, llvm::ToolContext const&) (/opt/compiler-explorer/clang-trunk/bin/clang+0xc4d071)
#36 0x0000000000b30454 main (/opt/compiler-explorer/clang-trunk/bin/clang+0xb30454)
#37 0x00007f06f7029d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#38 0x00007f06f7029e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#39 0x0000000000c4971e _start (/opt/compiler-explorer/clang-trunk/bin/clang+0xc4971e)
clang: error: clang frontend command failed with exit code 70 (use -v to see invocation)
Compiler returned: 70
Godbolt: https://godbolt.org/z/GTGx74fjz
Reduced LLVM IR:
target datalayout = "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128"
target triple = "riscv64-unknown-linux-gnu"
define i32 @main() #0 {
entry:
%0 = bitcast <vscale x 16 x i8> zeroinitializer to <vscale x 128 x i1>
%extract.t = extractelement <vscale x 128 x i1> %0, i64 0
%cond = select i1 %extract.t, i32 0, i32 1
store i32 %cond, ptr null, align 4
ret i32 0
}
attributes #0 = { "target-features"="+64bit,+v" }Godbolt: https://godbolt.org/z/fs6vjGj8W
Found via fuzzer.
Metadata
Metadata
Assignees
Labels
llvm:SelectionDAGSelectionDAGISel as wellSelectionDAGISel as well