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

    <tr>
        <th>Summary</th>
        <td>
            [Flang] Compilation error of CYCLE statement in DO construct with a label
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            flang:frontend
      </td>
    </tr>

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

    <tr>
      <th>Reporter</th>
      <td>
          ohno-fj
      </td>
    </tr>
</table>

<pre>
    ```
Version of flang-new : 18.0.0(c07062a2e9bf9aa1211b958f6bb4c5746139c180)
```

`CYCLE` statement in `DO` construct with a `label` results in a compilation error. 
If no `label` (10, 20, and 30) is specified, compilation terminates normally.

The following are the test program, Flang-new, Gfortran and ifort compilation result.

snfsm133_51.f90:
```fortran
program main
  integer ans1,ans2,ans3,ans4,a,b,c,j
  data ans1,ans2,ans3,ans4/0,0,0,0/
  bbb:do 20 c=1,1
     aaa:do 10 b=1,2
 vvv:do 30 j=1,1
           if (b.eq.1) goto 14
           do a=1,2
              ans1=ans1+1
              cycle
 ans2=ans2+1
           enddo
14         cycle aaa
30      enddo vvv
        ans3=ans3+1
10   enddo aaa
     ans4=ans4+1
20 enddo bbb
  write(6,*) "ans1=",ans1," ans=2",ans2," ans=3",ans3," ans=4",ans4
end program main
```

```
$ flang-new snfsm133_51.f90
error: Semantic errors in snfsm133_51.f90
./snfsm133_51.f90:13:18: error: CYCLE construct-name is not in scope
  14         cycle aaa
 ^^^
$
```

```
$ gfortran snfsm133_51.f90
$
```

```
$ ifort snfsm133_51.f90
$
```

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUVU-PqzYQ_zTmMgqyx0DCgUNe8qgqVXqHVpV6qgwY4hXYqe3sar99ZUOyIdn3pI0IFvPnN54Z-zfCOTVoKSuSfyP5MREXfzK2MidtNv1L0pjuvSIFXR56JHT_t7ROGQ2mh34Uetho-QaE74HtUppSgruWbmmBA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