<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/62830>62830</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
clang-15 hangs on a valid program
</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>
Below is the test case:
```c
int a, b, d = 2, e;
long long c = 1;
int
main ()
{
int g = 6;
L1:
e = d;
a;
goto L1;
g--;
int i = c >> ~(~e | ~g);
L2:
c = (b % c) * i;
if (!e)
goto L2;
;
}
```
When compile it with Clang 15, Clang 15 never terminates after reporting a warning:
```console
-> tmp $ clang-15 -O2 small.c
small.c:13:3: warning: expression result unused [-Wunused-value]
a;
^
^C
```
Below is my clang version:
```console
Ubuntu clang version 15.0.7
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/10
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/11
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/12
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/7
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/8
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/9
Selected GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/12
Candidate multilib: .;@m64
Selected multilib: .;@m64
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy0VU2PozgQ_TXmUgIZ85Fw4JBOmtVKI-1hdzXHlcEV8MrYyB_pnkv_9pVDms6MRr2XiZRAmap69eoZytw5OWrEllRPpDolPPjJ2PZFovVGJ70R39onVOYFpAM_IXh0HgbukBQHQk-EHkhN19-wrqX2wAk7Qh8vAkhxAhZNJMXTGqKMHuF6Ga7ufPNsEKsxc6mBsD1hzc2_uwUCxDrjNb3e0r_kGy0AvDrF5gTgd_b7HUbjDXzJ71xjmt6tYh15hYpkn0nxDG-E7d8QyO4Ib2PkttVnd_XX3gjb90BYBQNhDRB2AHkPfl7by3FrETZO7CPwQ6Dd6QfZ74X7OqGGwcyLVAjSw4v0ExwV1yPkVdyDdxs0XtCCRztLzT064GePFiwuxnqpR-Dwwq2WevzJRhvtjML1aRoF8fMChJUwRPg0ryD9g4GbuVLZ7a14XxSHvCDFIf7vCgC-Lhadk0aDRReUh6CDQwGkekq_rnZ64SogqU4_3c7q-cayej5-otD2Ms_fVrZwQRvr_k-bf_dB-_B9CuRVRrPdGvAXtyP62Mvrvv6nLtNlSJXU4TUddbiFTBa5gNkIVDFwMU6-rq7ftfNcKRQnaaOLsC44S1jXS71GdCZoAQPXQgruEX47HkGuWdyv_L_PYl2WEdYp2RPWjcNAWHdj9kGLdTl9LHz-WHj2UPjdY9GzKnus-vuHot_m1Z-ocPAofvWeHje-c1BexqziAFn85ks61-UP1T8L2j7pRLSFaIqGJ9jm9b6sq6bMm2RqmzOloj-LgheirEVRoGgq1tNzXw91s9slsmWUFbRiOd1XddVk_Tku-5KycmgopaSkOHOpMqUuc2bsmEjnArY12xc0UbxH5a6nLGMa4wRyAQlj8dC1bcxJ-zA6UlIlnXcfKF56he02WCeuRwdGA4cLV1LAYs1o-ZwEq9rJ-8XFQca6qLD0U-izwcxRdHV5v6WLNf_i4AnrriwcYd2V5X8BAAD__yEbV_I">