<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/163015>163015</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[AVR] fix issue with PEI pass prolog rewrite under register pressure
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
carlos4242
</td>
</tr>
</table>
<pre>
Investigation showed that in the AVR back end, under certain conditions of memory pressure, a corruption can occur with things like passing parameters on the stack.
The circumstances seem to need the PEI pass for AVR to attempt to rewrite the ADJCALLSTACKDOWN and STDWSPQRr/STDSPQRr instructions before the call to use the Z register as a temporary base pointer.
(See discussion at [https://discourse.llvm.org/t/avr-register-allocation-issue-help-advice-with-debugging/88498].)
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJxUUl9vgzYQ_zTm5UQEBlLywEPaLFK3auuaqJX2ZswFvBob3dnJ-u0noM20J4zs-_27n2I2vUNsRPUoqkOiYhg8NVqR9VzKUiat776aZ3dFDqZXwXgHPPgbdhAGFcA4CAPC_v0NWqU_AV0n5BNE1yGBRgrKONDedWYeZfAXGHH09AUTIXMknJ8r0J4oTgu8Vg681pHgZsIAYTCuZ7DmE2Ga9boeJkVqxIDE4FcBHJT-3IhsL7L9eUDQhnQcOSinkYERRwgeHC66EV5_eV7A4OJpER88qBBwnMJ8JLyRCbhaO_z6tH95OZ33T78d_vj4HZTr4HQ-fJxe_3wjIY-n82E5gnEcKOrVaIsXTyuCVtbOqJHX_7-AsDcckEAxKJhpPSn6glYxwuSNC0jfZoSsT4jQGdaRec5HBRDV4xDCxKLYC3kU8jhf-0iMG2uv48ZTL-QxCHlUV0p_2FJlrdfLDlPDHDEd0E6p6q5GYzqHnXbYxr43bh6v63JXi-qwEXKXdE3R7YqdSrDJH7aZzLPsoUqGprxkEtsL1sWufqjqSqKuc1XrrbpkbbYtEtPITFZ5luf5Li-LaqO1LOu81LKSO11oLcoMR2XsXXmyaGvybZHlVWJVi5aXfkrp8AbLrZByris181Daxp5FmVnDgf-DCSbYpdj79zdRHeBi_lmH117dKzCRt76_73yt7n1DPzVNItnm_6H3Jgyx3Wg_Cnmcab8_6UT-b9Rz_AsfC3n8dnNt5L8BAAD__-rIKhw">