<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/74648>74648</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Miscompilation with ir outliner
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
JonPsson1
</td>
</tr>
</table>
<pre>
clang -O3 -march=arch13 wrong1.i -o a.out -w -fno-inline -mllvm -ir-outliner -mllvm -keep-loops=false
This does not print the expected output - some of it is missing. Maybe the ir-outliner is not even supposed to work with keep-loops=false?
wrong1.i:
```
int printf(const char *, ...);
int a, b, c;
static int d;
void e(char) { a = 8; }
void f(long g) { e(g); }
int main() {
int h = 0;
for (; h < 9; h++) {
f(6);
if (b)
printf("index = %d\n", h);
}
printf(0);
h = 0;
for (; h < 9; h++) {
f(d);
if (b)
printf("index = %d\n", h);
}
h = 0;
for (; h < 7; h++) {
c = 0;
for (; c < 9; c++)
printf("%d\n", (long)h);
}
}
```
@arsenm
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyslM9uqzoQxp9m2IxAMIQQL1g0jbK4UnXv4r6AsR3wKdjINk379kcmaULOP51FJQTJ55nv-w1KhnuvO6NUA9UeqkPC59Bb1_xjzX_eW1MkrZUfjRi46TD9t8R05E70UB7ioyjx7KzpikxjapFndg6YnjE9GZtqM2ijMB2H4W3EVLvUziFK7qa9KjWlg7WTh_Jw4oNXkB8gf7rc_--1R2mVR2MDTk6bgKFXqN4nJYKSaOcwxUD0dlRoT6gDao-j9l6bLsMX_tGqpWUdri9-6k0Z9PM0Wa8kBotn617xrEOPv8Aqj2uyz6GhvAqwza_X8jWSLrwnoJ2wxgcUPXcI9AT0jFmWATEo9_dqHvU23sRN94EHLTAey5v4ZrVEFW177oAYQr1HjlAecAflHqE-rApj_mBNh91naWztLun32hgxcm2Adte6i45LeL-45zcExJONsyx58fAZF7seaL9cDw64QGzXA0dRn6JDG-WbhveXBkTaSPW-RANVEqpnA0TxDfUPXrchVt35Y9pXDCAfLL-Mfo3_F5j1nzDFT_0PDuI-qLg5XCvX5D_wXn9BQOx35PcPj_8C2OTceWVGTGRTSlYynqimqPNix6jeUtI3jEmqZF4ySTte15wKVSlBrKh220273SS6oZzKgvJtwSpGlLE6F4pzapmQLG9L2ORq5HrI4kbJrOsS7f2smnqz3eySgbdq8MtuIzLqjMthnKw6JK6JPWk7dx42-aB98HeXoMOgmhfthR0nPfCgrblsB-3wc5cksxuaPoS4KJ6AjkDHTod-bjNhR6BjdLs-0snZb0oEoOPC4IGOC-P3AAAA__-L8YIM">