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

    <tr>
        <th>Summary</th>
        <td>
            [flang] [OpenMP] flang-new crashes without appropriate message
        </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>
    Test case (modified from gfortran testsuite) 
(Original : https://github.com/gcc-mirror/gcc/blob/master/gcc/testsuite/gfortran.dg/gomp/substring.f90)

```console
$ cat substring_modify.f90
implicit none
character(len=10) :: str1, str2(5,5)

type t
  character(len=10) :: str1, str2(5,5)
end type t
type(t) :: v

!$omp target enter data map(to: str1)      ! OK
!$omp target enter data map(to: str2)      ! OK
!$omp target enter data map(to: str2(2,5)) ! OK

!$omp target enter data map(to: v%str1) ! OK
!$omp target enter data map(to: v%str2)       ! OK
!$omp target enter data map(to: v%str2(1,2))  ! OK

end
```

Compilation result (I snipped stack dump.)

```console
$ gfortran -fopenmp substring_modify.f90
$ ./a.out
$ flang-new -fopenmp substring_modify.f90
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
```

Compiler version
```console
$ flang-new --version
flang-new version 17.0.0 (https://github.com/llvm/llvm-project.git 9e8bac7480640677e04f4b9f98c41cb94f8180e2)
Target: x86_64-unknown-linux-gnu
Thread model: posix
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJysVUtv2zgQ_jX0ZWCBoh6WDjqkSQ0sdhcp0N4LihzJ3EgkQY7y-PcLynbsBou2adcwTA4588188zBljGa0iB2rPrDqbiMXOrjQPWxlCO4pbnqnX7ovGAmUjAhMNLPTZjCoYQhuhnFwgYK0QBgpLoaQiRYYv2P8honmPpjRWDkBK27gQOQjK26Y2DOxHw0dlj5Tbk6CUtvZhODCUWBi30-uZ2I_y0h4Ob1ysz_7zvSYJDd7JvZx6SMFY8dsaDkT7SmU42_Nj1_lbHQTnsMsQUmCV8uvK8WXFWDVMLOfjDIE1tmTkTrIINUaWTOhZcVdzlfmxU2iGinkTNymVTDRVEzcVm-CoRePQMc9wO_godVwjZb2TDR0Zf_4TRpEzkTpZg8kw4gEaAkDaEkSZumTqbs4bWH9MJHD_Z_vBhD_A0AjznQToWuYd4E9MlGdKf1KMCf7C6PfRGlSRcWJ1n_wQqvftO317a2bvZkkGWchYFwmSsP5B0RrvEcNkaR6AL3MPvvpKXgd5u3gPNrZf2cmkn7GxF5mbqHL0TBJO24tPv0Mxqe_Pt58_pgUZkMgoV9GCOhdICD3vb-LaXo8L1sf3D-oiIm9iXHByMQepNVgrJoWjUAHBBVkPEAv1QMFqTA7uv_8mqLk5UepxgCPGKJx9kdpvMrB9huTy8XpGPJdxjOeKvc-ttloCFpseql2ZcPrkte7HfJyKPt2aBtV5qpvy6HJG47itf5f1s5MXfjc1F_rcrvYB-ue7HYydnnejnY56R0CSg2z0zglbe-ieX7DeqO7QrdFKzfY5fWuaXdly-vNoRuGtpaVLrRsBqV2otxVTS4LLZq21XLgG9MJLgpe5HVeVBWvs1buWs2HelC8beoaWclxlmbKEuPMhXGzVrar87LKN5PscYrreyVEyuV6yYRIz1fo1iz1yxhZyScTKV5QyNC0PnRrHVh1B6z6cO_R_v0pCZfqrO2CEZ4MHdxCIL0PzgcjCWHGGOWImyVM3a936Erl3wAAAP__oFg_xQ">