<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/124275>124275</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
wrong code at -O1 and above on x86_64-linux-gnu
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
zhendongsu
</td>
</tr>
</table>
<pre>
It appears to be a recent regression from 19.1.0.
Compiler Explorer: https://godbolt.org/z/haMfGoo6h
```
[548] % clangtk -v
clang version 20.0.0git (https://github.com/llvm/llvm-project.git ddd2f57b29661f21308eec0400fa92a6d075b0c6)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /local/home/suz/suz-local/software/local/clang-trunk/bin
Build config: +assertions
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/11
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/12
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/12
Candidate multilib: .;@m64
Selected multilib: .;@m64
Found CUDA installation: /usr/local/cuda, version 12.1
[549] %
[549] % clangtk -O1 small.c
[550] % ./a.out
Aborted
[551] %
[551] % cat small.c
int printf(const char *, ...);
unsigned a;
int b, c = 1;
int main() {
int d;
a = -1;
if (a < 1)
goto e;
d = c;
if (d) {
e:;
}
if (!d)
__builtin_abort();
if (b)
goto e;
return 0;
}
```
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJysVMuO6zYM_RpmQ8SQ6Vey8MJJ6ou7KLpoux7IluKoI0uBHjPT-fpCdjKvogWKXiBIIOrw8FAhD_deTUbKFqoDVKcNj-FiXft6kUZYM_m4Gaz4s_0ekF-vkjuPweIgkaOTozQBnZyc9F5Zg2dnZ8z3WZ6xDIF1wLqjna9KS4c_vVy1ddJB0eElhKuHogPqgfrJisHqkFk3AfWvQP2F_3z-Zm19WTmgZrcP66A6VOUOqhMCVThqbqbwiNs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