<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/97185>97185</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[clang] Incorrect stack assignment when targeting i386-pc-win32-elf
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
LoveMHz
</td>
</tr>
</table>
<pre>
Arguments appear to be incorrectly placed onto the stack when targeting ``i386-pc-win32-elf`` but work as expected when targeting ``i386-pc-win32``.
In the reproduction sample provided, a variable of size 8 bytes is passed by value to the ``KeSetTimerEx`` function. In the ``i386-pc-win32-elf`` output, it's being passed as a pointer (dropping the byval IR compared to ``i386-pc-win32``).
Reproduction: https://godbolt.org/z/PMKzs8o81
I'm not sure if it helps, but it appears it could be related to the usage of the struct that wraps around the large int. In this example, https://godbolt.org/z/56KKWbbbE, it's correct under both targets.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyMU12PozYU_TXm5SoRmEDCAw_TzkYdTVeqtpX6bJsLuGtsy77ObPLrKwNVd6dquy-AbHzPh88RMerJIvas-YE1z4VINLvQ_-xu-PGnRyHdcO-fwpQWtBRBeI8iADmQCNoqFwIqMnfwRigcwFlyQDNCJKE-w9uMFkiECUnbCVhbsrbU9aU9eHV407bmBzTjtgwyEby58BlEBPziUREO3zFhWzqy8pmVT9vzxa4cAvrghqRIOwtRLN4g-OBuesCB8R9BwE0ELaRBcCNE_UC4gLwTRtARvIgRB5B3uAmTEHZhG9wr_or0m14wfPiy0x-TXZGOsMP_t1qXyCfKNDQxfo4gMQvcUUUEAd5pSxiA8csQnPd5Pw-W95sw8PIJlFu8CDhkbv_qDOPdN-Z8-soVVj_BTOQjq58YvzJ-ndwgnaGjCxPj1wfj118-vj7ixV2qbxxm_LyAdQQxBQQ9giaY0fiYFeWb1LSHJeZP5ZIZcmYCGkEb4ywlRTGt7m-ZCUkR0CwI3oLwEURwyQ7rpskZAG1p91fnkKx3mhH_T0TTvr7-LqX88JXhe3gh2QEDSEfzHrR4LIa-Hrq6EwX21bnqzhU_d6di7s-nRpzaUbaqKTvZcSXHZhxRcNVW_FRVhe55yU9lW5dl1XTN6ViNXHWqa8V4rur6ItmpxEVoczTmtmSGhY4xYd-dq0tTGCHRxLWLnCsj7MQ4z7UMff7_INMU2ak0OlL8ewJpMmuBtxPNM7z8Vc29iFvLc4ffN-of-SxSMP07PzXNSR6VWxi_ZtT9dfDB_YGKGL-uIiLj103Hred_BgAA__-W2Gjt">