Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assertion `UndefMask.isAllOnes() && "Fully undef mask expected"' failed. #60168

Closed
TatyanaDoubts opened this issue Jan 20, 2023 · 2 comments
Closed
Assignees
Labels
backend:X86 crash Prefer [crash-on-valid] or [crash-on-invalid]

Comments

@TatyanaDoubts
Copy link

TatyanaDoubts commented Jan 20, 2023

Godbolt repro: https://godbolt.org/z/naPqWjv6W

Run clang++ -O3 on the following test:
Test.cpp.zip

Stack dump:
 #0 0x000056396378e04f llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x40bc04f)
 #1 0x000056396378bfec llvm::sys::CleanupOnSignal(unsigned long) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x40b9fec)
 #2 0x00005639636d9368 CrashRecoverySignalHandler(int) CrashRecoveryContext.cpp:0:0
 #3 0x00007f78f3036420 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14420)
 #4 0x00007f78f2b0300b raise (/lib/x86_64-linux-gnu/libc.so.6+0x4300b)
 #5 0x00007f78f2ae2859 abort (/lib/x86_64-linux-gnu/libc.so.6+0x22859)
 #6 0x00007f78f2ae2729 (/lib/x86_64-linux-gnu/libc.so.6+0x22729)
 #7 0x00007f78f2af3fd6 (/lib/x86_64-linux-gnu/libc.so.6+0x33fd6)
 #8 0x000056396238c3f9 llvm::X86TargetLowering::LowerBUILD_VECTOR(llvm::SDValue, llvm::SelectionDAG&) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x2cba3f9)
 #9 0x00005639623c20a0 llvm::X86TargetLowering::LowerOperation(llvm::SDValue, llvm::SelectionDAG&) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x2cf00a0)
#10 0x00005639648b4ea3 (anonymous namespace)::SelectionDAGLegalize::LegalizeOp(llvm::SDNode*) (.part.0) LegalizeDAG.cpp:0:0
#11 0x00005639648c43ac llvm::SelectionDAG::Legalize() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x51f23ac)
#12 0x00005639649a289d llvm::SelectionDAGISel::CodeGenAndEmitDAG() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x52d089d)
#13 0x00005639649a62d8 llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x52d42d8)
#14 0x00005639649a825d llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) (.part.0) SelectionDAGISel.cpp:0:0
#15 0x0000563962242620 (anonymous namespace)::X86DAGToDAGISel::runOnMachineFunction(llvm::MachineFunction&) X86ISelDAGToDAG.cpp:0:0
#16 0x0000563962a0a4ce llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (.part.0) MachineFunctionPass.cpp:0:0
#17 0x0000563962fb3655 llvm::FPPassManager::runOnFunction(llvm::Function&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x38e1655)
#18 0x0000563962fb3899 llvm::FPPassManager::runOnModule(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x38e1899)
#19 0x0000563962fb40e2 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x38e20e2)
#20 0x0000563963b8cec0 (anonymous namespace)::EmitAssemblyHelper::EmitAssembly(clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream>>) BackendUtil.cpp:0:0
#21 0x0000563963b8d525 clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::HeaderSearchOptions const&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::StringRef, llvm::Module*, clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream>>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x44bb525)
#22 0x0000563964b0b8bb clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x54398bb)
#23 0x0000563965e04b05 clang::ParseAST(clang::Sema&, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6732b05)
#24 0x0000563964b0a338 clang::CodeGenAction::ExecuteAction() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x5438338)
#25 0x000056396437b3a9 clang::FrontendAction::Execute() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4ca93a9)
#26 0x00005639643012ae clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4c2f2ae)
#27 0x0000563964461053 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4d8f053)
#28 0x0000563960c27e7d cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x1555e7d)
#29 0x0000563960c23f97 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&) driver.cpp:0:0
#30 0x0000563964168f19 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
#31 0x00005639636d9850 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4007850)
#32 0x00005639641697cf 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
#33 0x0000563964131fac clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4a5ffac)
#34 0x0000563964132a2d 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+++0x4a60a2d)
#35 0x000056396413bbfc clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4a69bfc)
#36 0x0000563960c265e2 clang_main(int, char**) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x15545e2)
#37 0x00007f78f2ae4083 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24083)
#38 0x0000563960c1ec7e _start (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x154cc7e)
clang-16: error: clang frontend command failed with exit code 134 (use -v to see invocation)
Compiler returned: 134
@LebedevRI LebedevRI self-assigned this Jan 20, 2023
@LebedevRI
Copy link
Member

Reduced: https://godbolt.org/z/YYWzo8TsM

@EugeneZelenko EugeneZelenko added backend:X86 crash Prefer [crash-on-valid] or [crash-on-invalid] and removed new issue labels Jan 20, 2023
@llvmbot
Copy link
Member

llvmbot commented Jan 20, 2023

@llvm/issue-subscribers-backend-x86

CarlosAlbertoEnciso pushed a commit to SNSystems/llvm-debuginfo-analyzer that referenced this issue Jan 21, 2023
The original check was trying to avoid checking UndefMask itself,
and deduce it via simpler means, but checking `NonZeroMask`
does not, e.g., check `ZeroMask`.

Fixes llvm/llvm-project#60168
veselypeta pushed a commit to veselypeta/cherillvm that referenced this issue Jun 14, 2024
The original check was trying to avoid checking UndefMask itself,
and deduce it via simpler means, but checking `NonZeroMask`
does not, e.g., check `ZeroMask`.

Fixes llvm/llvm-project#60168
arichardson pushed a commit to arichardson/llvm-project that referenced this issue Nov 17, 2024
The original check was trying to avoid checking UndefMask itself,
and deduce it via simpler means, but checking `NonZeroMask`
does not, e.g., check `ZeroMask`.

Fixes llvm/llvm-project#60168
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend:X86 crash Prefer [crash-on-valid] or [crash-on-invalid]
Projects
None yet
Development

No branches or pull requests

4 participants