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

    <tr>
        <th>Summary</th>
        <td>
            `clangtk` crashes when processing a simple assignment loop wrapped by `#pragma omp unroll`
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

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

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

<pre>
    The testcase (compiled with `clang -fopenmp-simd small.c`):
```
void f(float *a, float *b) {
#pragma omp unroll
  for (int i = 0; i < 128; i++) {
    a[i] = b[i];
 }
}
```

Compiler Explorer: https://gcc.godbolt.org/z/Toh4vj1YP

Compiler version:
```
clang version 17.0.0 (https://github.com/llvm/llvm-project.git 12e9c7aaa66b7624b5d7666ce2794d912bf9e4b7)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /opt/compiler-explorer/clang-assertions-trunk/bin
Compiler returned: 0
```

Crash recovery log:
```
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 -S --gcc-toolchain=/opt/compiler-explorer/gcc-9.2.0 -fcolor-diagnostics -fno-crash-diagnostics -fopenmp-simd <source>
1.      <eof> parser at end of file
2.      <source>:1:6: LLVM IR generation of declaration 'f'
3.      <source>:1:6: Generating code for declaration 'f'
 #0 0x0000556a6b12089f llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-trunk/bin/clang+0x362e89f)
 #1 0x0000556a6b11e8cc llvm::sys::CleanupOnSignal(unsigned long) (/opt/compiler-explorer/clang-trunk/bin/clang+0x362c8cc)
 #2 0x0000556a6b06e588 CrashRecoverySignalHandler(int) CrashRecoveryContext.cpp:0:0
 #3 0x00007f61fd6dc420 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14420)
 #4 0x0000556a6e919644 clang::CapturedStmt::Capture::getCaptureKind() const (/opt/compiler-explorer/clang-trunk/bin/clang+0x6e27644)
 #5 0x0000556a6b457734 clang::CodeGen::CodeGenFunction::EmitSimpleOMPExecutableDirective(clang::OMPExecutableDirective const&) (/opt/compiler-explorer/clang-trunk/bin/clang+0x3965734)
 #6 0x0000556a6b42253d clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*, llvm::ArrayRef<clang::Attr const*>) (/opt/compiler-explorer/clang-trunk/bin/clang+0x393053d)
 #7 0x0000556a6b4284b9 clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt const&, bool, clang::CodeGen::AggValueSlot) (/opt/compiler-explorer/clang-trunk/bin/clang+0x39364b9)
 #8 0x0000556a6b489037 clang::CodeGen::CodeGenFunction::EmitFunctionBody(clang::Stmt const*) (/opt/compiler-explorer/clang-trunk/bin/clang+0x3997037)
 #9 0x0000556a6b494156 clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl, llvm::Function*, clang::CodeGen::CGFunctionInfo const&) (/opt/compiler-explorer/clang-trunk/bin/clang+0x39a2156)
#10 0x0000556a6b4ed36a clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl, llvm::GlobalValue*) (/opt/compiler-explorer/clang-trunk/bin/clang+0x39fb36a)
#11 0x0000556a6b4e9675 clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl, llvm::GlobalValue*) (/opt/compiler-explorer/clang-trunk/bin/clang+0x39f7675)
#12 0x0000556a6b4e9fe0 clang::CodeGen::CodeGenModule::EmitGlobal(clang::GlobalDecl) (/opt/compiler-explorer/clang-trunk/bin/clang+0x39f7fe0)
#13 0x0000556a6b4f19a7 clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*) (.part.0) CodeGenModule.cpp:0:0
#14 0x0000556a6c2bf09e (anonymous namespace)::CodeGeneratorImpl::HandleTopLevelDecl(clang::DeclGroupRef) ModuleBuilder.cpp:0:0
#15 0x0000556a6c2b145d clang::BackendConsumer::HandleTopLevelDecl(clang::DeclGroupRef) (/opt/compiler-explorer/clang-trunk/bin/clang+0x47bf45d)
#16 0x0000556a6d67a6d4 clang::ParseAST(clang::Sema&, bool, bool) (/opt/compiler-explorer/clang-trunk/bin/clang+0x5b886d4)
#17 0x0000556a6c2bc5ad clang::CodeGenAction::ExecuteAction() (/opt/compiler-explorer/clang-trunk/bin/clang+0x47ca5ad)
#18 0x0000556a6bb97f21 clang::FrontendAction::Execute() (/opt/compiler-explorer/clang-trunk/bin/clang+0x40a5f21)
#19 0x0000556a6bb1d353 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/compiler-explorer/clang-trunk/bin/clang+0x402b353)
#20 0x0000556a6bc78ec3 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/compiler-explorer/clang-trunk/bin/clang+0x4186ec3)
#21 0x0000556a6899491c cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/compiler-explorer/clang-trunk/bin/clang+0xea291c)
#22 0x0000556a6898ffdf ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) driver.cpp:0:0
#23 0x0000556a6b96ef5d 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 0x0000556a6b06ea07 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-trunk/bin/clang+0x357ca07)
#25 0x0000556a6b96f3fc 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 0x0000556a6b9362be clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/opt/compiler-explorer/clang-trunk/bin/clang+0x3e442be)
#27 0x0000556a6b936c8d 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+0x3e44c8d)
#28 0x0000556a6b94135c clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/opt/compiler-explorer/clang-trunk/bin/clang+0x3e4f35c)
#29 0x0000556a689924df clang_main(int, char**, llvm::ToolContext const&) (/opt/compiler-explorer/clang-trunk/bin/clang+0xea04df)
#30 0x0000556a6888e7c5 main (/opt/compiler-explorer/clang-trunk/bin/clang+0xd9c7c5)
#31 0x00007f61fd18a083 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24083)
#32 0x0000556a6898c2be _start (/opt/compiler-explorer/clang-trunk/bin/clang+0xe9a2be)
clang: error: clang frontend command failed with exit code 139 (use -v to see invocation)
Compiler returned: 139
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzkWltv4ziy_jXMC2FDInV9yIPjxH16Tg-m0Qnm4DwZFFmSOaFIgaRy2V-_0MWJ6bYz3Z3sYoEF0m2L4uX7vipVlUgz52SjAS5ReoXS6wvW-52xl48SrDf6ojLi-fJuB9iD85w5wIgU3LSdVCDwo_Q7jLKIK6YbvKhNB7rtFk62AruWKbXkKIsQKRFdoegaRavhcvobLx-MFLhGpKiVYR4jsmKIrPHLVYVIiVF-NQ8mtLOsaRk2bYd7bY1S0x2Ma2MHaFJ7LDGi1zhC9Gr8usYxKcYLRK7Gv4MpMcaYofRKovR6HFbNF4jue6D8el7-5UtIYvp_PYli8c1Tp4wFi-gK77zv3ECebBDZNJwvGyMqo_zS2AaRzT8Q2dyZXfLwV_z_X0_O9gDWSaPPCTg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