-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Open
Labels
backend:X86clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"crashPrefer [crash-on-valid] or [crash-on-invalid]Prefer [crash-on-valid] or [crash-on-invalid]generated by fuzzer
Description
Clang crashes when using SSE4.1 intrinsics (like _mm_blendv_epi8) without the appropriate target flag (-msse4.1), while GCC correctly provides a clear diagnostic message.
Repro: https://godbolt.org/z/x1Wvc98b1
Program
#include <immintrin.h>
const int8_t scalarValue = 1;
__m128i vector1 = _mm_set1_epi8(scalarValue);
__m128i vector2 = _mm_set1_epi8(2);
__m128i vector3 = _mm_set1_epi8(3);
__m128i resultVector = _mm_blendv_epi8(vector2, vector3, vector1);
Stack Dump
fatal error: error in backend: Cannot select: 0x3f174100: v16i8 = X86ISD::BLENDV 0x3f173f40, 0x3f173e60, 0x3f173d80, example.cpp:7:24
0x3f173f40: v16i8,ch = CopyFromReg 0x3f07fd50, Register:v16i8 %5, example.cpp:7:24
0x3f173e60: v16i8,ch = CopyFromReg 0x3f07fd50, Register:v16i8 %4, example.cpp:7:24
0x3f173d80: v16i8,ch = CopyFromReg 0x3f07fd50, Register:v16i8 %3, example.cpp:7:24
In function: __cxx_global_var_init
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++ -gdwarf-4 -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 <source>
1. <eof> parser at end of file
2. Code generation
3. Running pass 'Function Pass Manager' on module '<source>'.
4. Running pass 'X86 DAG->DAG Instruction Selection' on function '@__cxx_global_var_init'
#0 0x0000000003ca5fb8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x3ca5fb8)
#1 0x0000000003ca398c llvm::sys::CleanupOnSignal(unsigned long) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x3ca398c)
#2 0x0000000003bf41d3 llvm::CrashRecoveryContext::HandleExit(int) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x3bf41d3)
#3 0x0000000003c9b1de llvm::sys::Process::Exit(int, bool) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x3c9b1de)
#4 0x0000000000db8b9b LLVMErrorHandler(void*, char const*, bool) cc1_main.cpp:0:0
#5 0x0000000003bfe103 llvm::report_fatal_error(llvm::Twine const&, bool) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x3bfe103)
#6 0x00000000052686aa llvm::SelectionDAGISel::CannotYetSelect(llvm::SDNode*) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x52686aa)
#7 0x000000000526e581 llvm::SelectionDAGISel::SelectCodeCommon(llvm::SDNode*, unsigned char const*, unsigned int) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x526e581)
#8 0x000000000276156a (anonymous namespace)::X86DAGToDAGISel::Select(llvm::SDNode*) X86ISelDAGToDAG.cpp:0:0
#9 0x0000000005265804 llvm::SelectionDAGISel::DoInstructionSelection() (/opt/compiler-explorer/clang-trunk/bin/clang+++0x5265804)
#10 0x0000000005274152 llvm::SelectionDAGISel::CodeGenAndEmitDAG() (/opt/compiler-explorer/clang-trunk/bin/clang+++0x5274152)
#11 0x0000000005277116 llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x5277116)
#12 0x0000000005278916 llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x5278916)
#13 0x0000000005265391 llvm::SelectionDAGISelLegacy::runOnMachineFunction(llvm::MachineFunction&) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x5265391)
#14 0x0000000003086c5d llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x3086c5d)
#15 0x00000000035ffee2 llvm::FPPassManager::runOnFunction(llvm::Function&) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x35ffee2)
#16 0x0000000003600171 llvm::FPPassManager::runOnModule(llvm::Module&) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x3600171)
#17 0x0000000003601ab9 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x3601ab9)
#18 0x0000000003f4f0c0 clang::emitBackendOutput(clang::CompilerInstance&, clang::CodeGenOptions&, 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+++0x3f4f0c0)
#19 0x00000000045f019c clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x45f019c)
#20 0x000000000625873c clang::ParseAST(clang::Sema&, bool, bool) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x625873c)
#21 0x00000000045f098d clang::CodeGenAction::ExecuteAction() (/opt/compiler-explorer/clang-trunk/bin/clang+++0x45f098d)
#22 0x00000000048fa40a clang::FrontendAction::Execute() (/opt/compiler-explorer/clang-trunk/bin/clang+++0x48fa40a)
#23 0x000000000487546b clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x487546b)
#24 0x00000000049ee543 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x49ee543)
#25 0x0000000000dbabf5 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/compiler-explorer/clang-trunk/bin/clang+++0xdbabf5)
#26 0x0000000000db2b4d ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) driver.cpp:0:0
#27 0x00000000046628f9 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
#28 0x0000000003bf40d3 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x3bf40d3)
#29 0x0000000004662b19 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
#30 0x0000000004625fbd clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/opt/compiler-explorer/clang-trunk/bin/clang+++0x4625fbd)
#31 0x0000000004626f71 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+++0x4626f71)
#32 0x000000000463370c clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x463370c)
#33 0x0000000000db7411 clang_main(int, char**, llvm::ToolContext const&) (/opt/compiler-explorer/clang-trunk/bin/clang+++0xdb7411)
#34 0x0000000000c67984 main (/opt/compiler-explorer/clang-trunk/bin/clang+++0xc67984)
#35 0x00007176a7c29d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#36 0x00007176a7c29e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#37 0x0000000000db25e5 _start (/opt/compiler-explorer/clang-trunk/bin/clang+++0xdb25e5)
clang++: error: clang frontend command failed with exit code 70 (use -v to see invocation)
Compiler returned: 70
Metadata
Metadata
Assignees
Labels
backend:X86clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"crashPrefer [crash-on-valid] or [crash-on-invalid]Prefer [crash-on-valid] or [crash-on-invalid]generated by fuzzer