<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/118172>118172</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[SDAG] Miscompilation with unused functions
</td>
</tr>
<tr>
<th>Labels</th>
<td>
llvm:codegen,
miscompilation
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
dtcxzyw
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
dtcxzyw
</td>
</tr>
</table>
<pre>
Reproducer: https://godbolt.org/z/h4T6Gh5f4
```
#include <stdint.h>
#include <stdio.h>
uint8_t b;
int32_t i;
static int32_t e = -6L;
uint16_t g;
int8_t j;
void r() {
for (e = 9;;)
;
}
void u() { e = 0; }
static void o(int8_t t) {
g = t;
if ((b = t) | j)
i = 0;
}
int main() {
o(e);
printf("%d\n", (int)g);
return 0;
}
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxsU8lupDwQfpriYqVlytDYBw50908u_1xm5h4BNuCItlu4nEzy9COWrBoJCVz1bSXKTQh2cMaUkJ8AUVP35_XlGRAhvyRNpNHP5V5MWq9fyp_mNnsdOzODqNhIdAsgKsAasB68bv1EBz8PgPUrYD1mv4_3Y95nwCs48v3hFaCwrpuiNgzEOZC2jg4jiP_-2fNvrWgdyQdiLYgT8Mo6EvhAzG7HQA3Zjr1VF_qF3R3_37oLNz0-EBveyYvU43Z68lazGVACKgbFUmKs9zMDlJuQWoDiBKjWHmMbEYrLGz1-0HdzDuLENsQebgV6QLnb02e_YSXRJsyY7dmqKNu9vkLP7PEjg323eY9iHbFrY923WRZPsxB38dtsHfUrCAFzDfnZrZ9ntqUDVMMn_Gwozu6r1ec_muhSaCVUk5gyLQSqolAck7GUukMjVd-oY592OlW9lC1vU660lDJLE1sixyxNBU-zLOd4MCovOB5TISTnPZeQcXNt7HSYpqfrslyJDSGaMk1lWmAyNa2Zwr7ACwRE1XltBrMPBIhXGzp_vdmpIevdvt5zuaDv2jgEyPhkA4UPC7I0rbfi16W6h_zCfnyRYM-WRhZdDEazPrpuKYYkzlP57U5YGmN76PwVsF7Tba-72-wfTUeA9TpNAKz3gZ5K_BsAAP__QrEEbQ">