<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/64886>64886</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Infinite loop in MemCpyOpt/MemSSA
</td>
</tr>
<tr>
<th>Labels</th>
<td>
llvm:hang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
dcci
</td>
</tr>
</table>
<pre>
```
bash-3.2$ time xcrun ./clang -O1 unred.cpp -w
^C
real 0m12.947s
user 0m0.063s
sys 0m0.012s
bash-3.2$ time xcrun ./clang -O0 unred.cpp -w
real 0m0.265s
user 0m0.203s
sys 0m0.040s
bash-3.2$ cat unred.cpp
#define main wrap_main
#include <string.h>
static char const * global39 = ((char const *)(""));
int main(int argc, char** argv){
{
strncpy((((char*)(-1))-((char volatile )(1048576ULL))),global39,(*((unsigned long long*)(1))));
}
void* i72 = memcpy(((void*)(((void*)(-1)))),((void const *)(((unsigned long*)(0)))),(((__int128_t)(4ULL))<<((long const )((-68719476736LL)))));
return strncmp(((char const *)(1)),((char const *)("")),((unsigned long long)((511LL))));
}
#undef main
int main(int argc, char **argv) {
}
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyMVMGOozgQ_RpzsUB2GQwcODDpibTSjOYw2nPLgBu8MgbZpnvz9ysMSTqdZHdbJdqqKtd79api4ZzqjZQVyr6h7CUSix8mW3Vtq6Jm6k4V4mQ38oJI3Qg3xCwBBCn2apT479YuBicIjq0WpsfxL4oXY2WXtPOM44_tGsq-H_ZT-FopNCIlGSkkZZq7zbs4aYOXJISz3elO7uyj4P43C_KIxS02SYBn99BAHkCn5AF0K_wVZYcA1sk3ZSQehTL4w4r5dT1dosq0eukkRuzgvFWmTwbEvm9hjLHzwqsWt4OwuJ2M8xhBjXs9NUKzEiP2ghEUCIrbDARlcEOwcjX27VL06Z8yPvBEUKxHYfsWwSGgh6L16npfq-XPq11jzlvTzqeN4JXmhV9MN27xpxbeJy280hJvKZSkRZbzP3_82NtY7XDuH8EhXK23AosJy9thPZk-fC5Q9NP1p1qg_OVpV--T6lYBVA5B9VGOn1vbw2fd71zxLYGdd8i5n9pdL5cYeVgFQfH6qoynULz6LTG9KsYOq4WsoMsZbseKeZHTMs15zviNyrdKWekXa7aRjvPNPL82QL_Q-8_VPCc-mt_OMqP0C7mn-3yZIgK2mE6-4esP7l8WfONW7wuOn2_4tf75KYy6inUlK0UkK8pL4DkQkkVDJXlbcsobaAiFlApeUJBAU5GlgtCCRaoCAowUAARSQrIkKzL2RkWaFhIYzwqUEjkKpROt38dksn2knFtkxdOi4JEWjdQuvNUAawZi9SBW2WB9vG21-uJm6R1KiVbOu2sdr7yW1R_mTRnlJdbTNGNl8E85HubTr9kjOP6U4-_fdbRYXQ3ezw6xGsERwbFXfliapJ1GBMeAu_2LZzv9Jdv1bqDpEBwD038CAAD__wLwrgs">