<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/96637>96637</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
lto + try-catch affect sp point in x86
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
SihangZhu
</td>
</tr>
</table>
<pre>
follow is example code
```
#include <stdio.h>
void f (int i)
{
throw i;
}
int main ()
{
void *sp1 = __builtin_alloca (0);
try
{
f (0);
}
catch (int)
{
}
void *sp2 = __builtin_alloca (0);
if(sp1 != sp2) {printf("sp1 != sp2\n");}
else {printf("sp1 == sp2\n");}
return (sp1 != sp2);
}
```
compiling commands:
`clang++ -flto demo.cpp -o demo.exe -std=c++11`
the result of this demo is "sp1 == sp2" compiled with gcc, while clang is "sp1 != sp2"
Is there some wrong in llvm's lto
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyMk01vozwQxz-NuYwSwTi8HTg05Yn0nPe2l4rYA_bK2Aibpv32K0OStptqtRIyY3l-M_-xZzrv9WCJGpYfWd4m3RKUm5sfWnV2-KmW5Ozke9M7Y9wFtAd668bJEAgniaUtS59YkV6_bYtcW2EWScD4sw9Su71i_L_t9NVpCT0wrLQNoBnWV6o8bgZAUHNMxfjxdtRejXWN3NhpG2N8h68ZGD75KQPGW3h5OS_aBG1fOmOc6CKXRvAe_5Z3fr-ZAB8B-wdgO29vG9EFoa4V3QV9jfEZeNSJ_6YTQPcMq7UuzCLiJ2RYxzzTrG3o1xvBPxzyZ8sQr4Huqsl4-hbk7V_Bm5SZwjKvb_Cg55uH-9ohwo2TNtoOINw4dlZ6xp_unsJ0dmB4ZHiEXW-CA0mj24tpgt3VpjeCnQ-S8VZsnln20X_rGhTBTH4xAVwPQWm_orGDHytFhE0TSbjooGAQguEzXJSOnR4FfQY_FYtbtv89BEUzgXcjwWV2EbBgzOvIsPQQq9g8E9lwWfO6S6jJyqzmiGVWJKoRKPKqEkUvDilJSvO6Tw-yykReiLQqZKIbTPGQFphnnFe82Mu0zMu8yETBc17Knh1SGjtt9jHt3s1Dor1fqKmLgpeJ6c5k_DrliJbiLPuFYgV5m8xNZHbnZfDskBrtg_-IEnQw1Gw14DGOyW5r-a7vSQTwE0xunWYLb1WRLLNpVAjT-qp4YngadFDLeS_cyPC0Xcr6202z-0UiMDytajzD06b2tcHfAQAA__-jtUlx">