<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/62522>62522</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[flang] [OpenMP] flang-new crashes (!$omp do)
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
k-arrows
</td>
</tr>
</table>
<pre>
```console
$ cat test.f90
program test
implicit none
integer :: i, j
!$omp do
do i = 1, 10
do j = 1, 10
exit
end do
end do
end program
```
Stack dump:
```console
#0 0x000055f9fb489638 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int)
#1 0x000055f9fb4875ae llvm::sys::RunSignalHandlers()
#2 0x000055f9fb489f68 SignalHandler(int) Signals.cpp:0:0
#3 0x00007f75247ed520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
#4 0x000055f9fd2d4352 mlir::BranchOpInterface::Concept* mlir::detail::InterfaceMap::lookup<mlir::BranchOpInterface>() const
#5 0x000055f9fd2d4216 mlir::OpInterface<mlir::BranchOpInterface, mlir::detail::BranchOpInterfaceInterfaceTraits>::getInterfaceFor(mlir::Operation*)
#6 0x000055f9fd2d0c2f deleteDeadness(mlir::RewriterBase&, llvm::MutableArrayRef<mlir::Region>, (anonymous namespace)::LiveMap&) RegionUtils.cpp:0:0
#7 0x000055f9fd2d0f7d deleteDeadness(mlir::RewriterBase&, llvm::MutableArrayRef<mlir::Region>, (anonymous namespace)::LiveMap&) RegionUtils.cpp:0:0
#8 0x000055f9fd2d1254 mlir::simplifyRegions(mlir::RewriterBase&, llvm::MutableArrayRef<mlir::Region>)
#9 0x000055f9fb7a3f81 (anonymous namespace)::FirConverter::lowerFunc(Fortran::lower::pft::FunctionLikeUnit&) Bridge.cpp:0:0
#10 0x000055f9fb76575c Fortran::lower::LoweringBridge::lower(Fortran::parser::Program const&, Fortran::semantics::SemanticsContext const&)
#11 0x000055f9fb691725 Fortran::frontend::CodeGenAction::beginSourceFileAction()
#12 0x000055f9fb4b67ec Fortran::frontend::FrontendAction::beginSourceFile(Fortran::frontend::CompilerInstance&, Fortran::frontend::FrontendInputFile const&)
#13 0x000055f9fb4a9dbf Fortran::frontend::CompilerInstance::executeAction(Fortran::frontend::FrontendAction&)
#14 0x000055f9fb4b9fde Fortran::frontend::executeCompilerInvocation(Fortran::frontend::CompilerInstance*)
#15 0x000055f9fa41af21 fc1_main(llvm::ArrayRef<char const*>, char const*)
#16 0x000055f9fa418f66 main
#17 0x00007f75247d4d90 __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
#18 0x00007f75247d4e40 call_init ./csu/../csu/libc-start.c:128:20
#19 0x00007f75247d4e40 __libc_start_main ./csu/../csu/libc-start.c:379:5
#20 0x000055f9fa418995 _start
flang-new: error: unable to execute command: Segmentation fault
flang-new: error: flang frontend command failed due to signal (use -v to see invocation)
flang-new version 16.0.3 (https://github.com/llvm/llvm-project da3cd333bea572fb10470f610a27f22bcb84b08c)
Target: x86_64-unknown-linux-gnu
Thread model: posix
```
Program arguments:
```console
flang-new -fc1 -triple x86_64-unknown-linux-gnu -emit-obj -fopenmp -fcolor-diagnostics -mrelocation-model pic -pic-level 2 -pic-is-pie -target-cpu x86-64 -o /tmp/test-f4ddf1.o -x f95-cpp-input test.f90
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzUV19v4y4W_TTkBTnC-P9DHtJ2szvSjH6jdn7PFYZrh9YGC3CbfvsVtpPYnjazK-3LVm2KL5dz7j2-uQCzVtYKYIeSO5Q8bFjvjtrsXgNmjH63m1KLjx1KyfjLtbK6AUQeENkjGmPOHHZg3bYqyGjtjK4NawfraMFYtl0juXRYaQUXo3JQg8Eo2qNojyWi9_hlQp5cEA0RjXXbYaHPNqGxxCh6wKFfEJKz3f8IjV--moOTdItnJWao86fx01umXCbzWYS515Nj_BWLvu18Gku_hVgY0YhgciKEkCSpiqqM8yK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