<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/85176>85176</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Miscompile of musl-c memset on ARM
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          AtariDreams
      </td>
    </tr>
</table>

<pre>
    comparing the assembler output of memset from the Musl-C library, I noticed that the final compilation is missing the assignment of the sum of r2 (which would be the size argument) and r0 (the pointer argument). This doesn't happen in LLVM-17. 

As a result, memory is being written right before the dest pointer instead of at the tail end. 


![image](https://github.com/llvm/llvm-project/assets/83477269/774c4a7c-1d08-40fa-9358-11a0253ede30)
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUUk2L2zAQ_TXyZUiQJTu2Dz5kdwkUNpdSeh9bE3uKPoIkN2x_fZG32-61IJDQPM178_QwJV480SjaJ9G-VLjlNcTxnDHySyR0qZqCeRvn4O4Y2S-QVwJMidxkKULY8n3LEG7gyCXKcIvB7ZjrluzhGSxPEeObUM_wBXzIPJOBvGLeQTf2aKE0Z4uZgwdO4DilT0y8eEd-5yg3aXPlGBUI1T9Wnld4hM0amOi9zr8IMC5beSTUAOgNRFnQpXwP7DPFz4gjfFs5gQmUvFBdhhXvd_LAHl5fv18PdXcEIc9Cns8JECKlzeYykCMX4luRPFER_IicM3mIvKwZJrqF-K7JUMp_mdmnTGjKEH9cyMgWyJsPmrJULdondriQaF-E6tec70nos1AXoS4L53WbjnNwQl2s_fmxHe4x_KA5C3Upf5STUJdeN12nToNQl65r5ga7-VAb2R8aecPDoNv-UNcoVavJkJZCDZUZtRn0gBWNdVdLPdS16qt1nLUeatnPqtOyPZFsZsTeaGWGtqlJyYpHJVUjdd3IRvdNf0TVIprWnHoztV1_E40kh2yPRe0xxKXilDYa-7buTpXFiWzas6iUpwfsRaFUiWYc9wmnbUmikZZTTv-6ZM6Wxiun9yzRnsiSwPkjmMHD-eu12qId_9vLXcbuZZH5OwAA__-S1Atm">