<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/105537>105537</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
miscompilation with -fstrict-vtable-pointers
</td>
</tr>
<tr>
<th>Labels</th>
<td>
miscompilation,
llvm:transforms
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
sylvain-audi
</td>
</tr>
</table>
<pre>
I noticed invalid code generation using `-fstrict-vtable-pointers` on clang 18.1.0.
Here is a repro: https://godbolt.org/z/h9bx14bWG
Notice the `@llvm.memcpy.p0.p0.i64` call with an `undef` parameter, it seems to be the cause of the runtime crash.
Notes:
- Bisecting on llvm passes (argument `-mllvm -opt-bisect-limit=`), I found that the issue appears with an SROA pass.
- The generated code was valid with clang 17.0.1. By bisecting on git, the invalid generation started with the commit from this PR: https://github.com/llvm/llvm-project/pull/72056
@antoniofrighetto @nikic could you identify whether this is an SROA bug?
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUk0Gvq7YTxT-N2YxAxkBCFixy3xX__9u01Wulro0ZYFpjI3vIbfrpK5zoNq3aRSUEsozP_OacsY6RZofYieZNNO-Z3nnxoYt3e9Pkcr2PlA1-vHdfwXkmgyOQu2lLIxg_IszoMGgm72CP5GYQJ5lPkQMZzm-sB4v55skxhihOErwDY7WboWyLspCFkO9CXh_v_2NAoAgaAm7Bi-oKC_MWRXUVqheqn_04eMuFD7NQ_e9C9ctl-K2sh5__96rzXQIFXvCgEbW09rYWK65muxebPB461QeN0dbCB_EC2h3_7m7E6djYdNArMgahvgAxRMQ1AnsYHrpG7xHBT2kRdse0Ipig41L8jQQTflpBDm8U0fDhk3dwYMGmY8QIQrU6zPuKjpOFa9rM_cb5kM7kllZiUb0fLanLwfUVJr-7EXjRnEAoxh1BbxvqED_7-vHb99dUpvjE-Gn5TA6fQX7oCI9c07lnSOdCFmUBb3cYXsln4gMg1XxOw8sgRNbh0E1CyS2_rsQwBb8CLxThh2__EC7xsg-F8atQ_dH985Nvwf-ChoXqt91aofqzks3p1WZRS-3YO_JToHlBZg-ilo5-JQPG73aEu9-BRnRM0x0-FuQFw4PlGLinScM-i6p_Vc7Grhov1UVn2JVnVatGns-XbOka3VamndryYiZ5UUNdTmN7UlU91Dio6pxRp6SqZavKsq5U0xZVNSkt22kwlamnCkUtcdVkizSdPsxZiq8rZdNU58zqAW1M11KplaLx60Y2GSyUEuqLUCq5VF05aBcnH9Z47DTvWeiSccM-x2P6KXL8swoTW-z-qviI6t_ubbYH2_3nsFI3Uaj-2dCtU38EAAD__x0qcDk">