<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/114214>114214</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [OpenMP]Clang is aborting when a depend object is initialized with omp_all_memory locator
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang:openmp
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          chandraghale
      </td>
    </tr>
</table>

<pre>
    codegen crash in Clang  occurring when a depend object was initialized with omp_all_memory locator in the depobj directive. 
Here is reduced test case : 

```
#include <omp.h>
int main()
{ omp_depend_t obj;
 #pragma omp depobj(obj) depend(inout: omp_all_memory)
 }
```

Stack dump:
```
0.      Program arguments: /opt/compiler-explorer/clang-trunk/bin/clang++ -gdwarf-4 -g -o /app/output.s -fno-verbose-asm -S --gcc-toolchain=/opt/compiler-explorer/gcc-snapshot -fcolor-diagnostics -fno-crash-diagnostics -fopenmp -emit-llvm -S <source>
1.      <eof> parser at end of file
2.      Per-file LLVM IR generation
3.      <source>:3:5: Generating code for declaration 'main'
 #0 0x000000000396eb08 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x396eb08)
 #1 0x000000000396cc54 llvm::sys::CleanupOnSignal(unsigned long) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x396cc54)
 #2 0x00000000038bd7f8 CrashRecoverySignalHandler(int) CrashRecoveryContext.cpp:0:0
 #3 0x000071cd32a42520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #4 0x000000000410fbdf clang::CodeGen::CodeGenFunction::EmitStoreOfScalar(llvm::Value*, clang::CodeGen::Address, bool, clang::QualType, clang::CodeGen::LValueBaseInfo, clang::CodeGen::TBAAAccessInfo, bool, bool) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x410fbdf)
 #5 0x0000000003cbf073 clang::CodeGen::CodeGenFunction::EmitOMPDepobjDirective(clang::OMPDepobjDirective const&) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x3cbf073)
 #6 0x0000000003ca991b clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*, llvm::ArrayRef<clang::Attr const*>) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x3ca991b)
 #7 0x0000000003cb0b19 clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt const&, bool, clang::CodeGen::AggValueSlot) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x3cb0b19)
 #8 0x0000000003d1880a clang::CodeGen::CodeGenFunction::EmitFunctionBody(clang::Stmt const*) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x3d1880a)
 #9 0x0000000003d234c5 clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl, llvm::Function*, clang::CodeGen::CGFunctionInfo const&) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x3d234c5)
#10 0x0000000003d80f1b clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl, llvm::GlobalValue*) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x3d80f1b)
#11 0x0000000003d7c395 clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl, llvm::GlobalValue*) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x3d7c395)
#12 0x0000000003d87b71 clang::CodeGen::CodeGenModule::EmitDeferred() (/opt/compiler-explorer/clang-trunk/bin/clang+++0x3d87b71)
#13 0x0000000003d89b03 clang::CodeGen::CodeGenModule::Release() (/opt/compiler-explorer/clang-trunk/bin/clang+++0x3d89b03)
#14 0x00000000042b6d3e (anonymous namespace)::CodeGeneratorImpl::HandleTranslationUnit(clang::ASTContext&) ModuleBuilder.cpp:0:0
#15 0x00000000042b47b5 clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x42b47b5)
#16 0x00000000062afb6c clang::ParseAST(clang::Sema&, bool, bool) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x62afb6c)
#17 0x00000000042b5135 clang::CodeGenAction::ExecuteAction() (/opt/compiler-explorer/clang-trunk/bin/clang+++0x42b5135)
#18 0x000000000457de71 clang::FrontendAction::Execute() (/opt/compiler-explorer/clang-trunk/bin/clang+++0x457de71)
#19 0x00000000044fdd3b clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x44fdd3b)
#20 0x0000000004662293 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x4662293)
#21 0x0000000000cebe0c cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/compiler-explorer/clang-trunk/bin/clang+++0xcebe0c)
#22 0x0000000000ce486d ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) driver.cpp:0:0
#23 0x00000000042fcf59 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
#24 0x00000000038bdc23 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x38bdc23)
#25 0x00000000042fd179 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
#26 0x00000000042c4b1d clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/opt/compiler-explorer/clang-trunk/bin/clang+++0x42c4b1d)
#27 0x00000000042c5b1d 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+++0x42c5b1d)
#28 0x00000000042cf0cc clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x42cf0cc)
#29 0x0000000000ce8b61 clang_main(int, char**, llvm::ToolContext const&) (/opt/compiler-explorer/clang-trunk/bin/clang+++0xce8b61)
#30 0x0000000000bb9fc4 main (/opt/compiler-explorer/clang-trunk/bin/clang+++0xbb9fc4)
#31 0x000071cd32a29d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#32 0x000071cd32a29e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#33 0x0000000000ce430e _start (/opt/compiler-explorer/clang-trunk/bin/clang+++0xce430e)

```

https://godbolt.org/z/4e8Pdejjx
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzkWVFz2ywW_TXkhZFHQrIlP-TBset-7bTTbJ3tPnoQIJkWgQZQmny_fgckx0Zx0qaj3dmZ7TROjK6455x74V4hbAyvJWPXYH4D5psr3NmD0tfkgCXVuD5gwa5KRR-viaKsZhISjc0BcgnXAssaQkVIpzWXNfx5YBJiSFnLJIWq_M6IhT-xgVxyy7HgfzMKf3J7gKpp91iIfcMapR-hUARbpd2k9sDcBKr8DinXjFh-z2YQxBsQr_5imkFuoGa0I4xCy4yFBBsGQboabIbPRTz877-ilEsiOuos16ppZweQvuuvcWlhg7kEqABoOdjnNx5iz2RvHReQ3vQXIUBpq3HdYGczgAWo8J_LgT1ABZeqsw5YSPbJCQT55jJa_7mzmPyAtGtakF5mFc9AvLzVqta4gVjXXcOkNV4KtFWtBWhLVNNywXTEHlqhNNNuzIUtsrqTPwDalo55PwbQDUA3MKrpT6yrKINRDSPlJsNt66bsbNvZmYFRJVV0z3SpDIuwaWC0g1FUExJZpQQ5ODXTzasgnLGRuDUHZWFUESWUjijHtVTGcjL48Kk2GlYtk00L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