<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/55061>55061</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Simple X32 miscompilation
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
henke96
</td>
</tr>
</table>
<pre>
test.c:
```c
void test(void) {
*(int *)0x80000000 = 0x123;
}
```
Compile with: `clang -target x86_64-unknown-linux-gnux32 -O1 -c test.c`
`objdump test.o --disassemble=test` shows:
```
00000000 <test>:
0: c7 04 25 00 00 00 80 movl $0x123,0xffffffff80000000
7: 23 01 00 00
b: c3 retq
```
It stores the value to address `0xffffffff80000000` instead of the expected `0x80000000`.
Seems to only happen with optimizations enabled, and only if bit 32 is set in the address.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxtUktvnDAQ_jXmMgJ5zfvAIdltpZ56yKW3yuABnBibYrO76a-vMZtNlMayzAzz-L55tEa8Ng6tSzqSPhB6IvSBFHS_3a6fjRSw-RBWbTJhNZDycTeCP4Q9eJPUbpdqeq3ofoCkJ6DXA0tJegsg5ekTzK4ezTRLhXCRbvRUYMNXXA8QO74M6OBaFb-LLF71izYXHSup12s8-CdlEP88QNzBrZC3lHcc0z6LdZp3u4E4FtJya3FqFXqGobaCgh3Nxf7fhl2l7yUdQ0D67e7qe0A3zgBdCTQDloN33G9FtxZN5qxCp7K9G-xIr_3tvDXrnqvcc7EU6OGW5W5rbzgpfHkWdH_gS_77-8OBdWZBC25EOHO1IjgDXAj_z25N_4KXb43U1iEXYPoQiNcZO4diD_jgmHwEe0Kc7JbeaPUKI59n1GG-YGYnJ_mXO2m0BdTcD8Lv1RG4Fru37KGVDvxspQXrxy91QL4xTSLRpKJOax456RQ2T3Ka_fb88gGTtF1YppA-WhfVjM7NYbLsu7-Dp7C2iXfyilLnt088L-bZ1-VVae2K1gt5TotDNDaMsb7sRJ9ii3VX8qzHCtOa5aLkObIyUrxFZRuSPxLGNF4gpPAyyU-RbBhljGZ-_NWB5VnS1oeCdawTWd8eaFmRjOLEpUo2HolZhmhpAqV2Haw3KmmdfTf65ZWDRgxwPj9f3WiWZkT9gnURBegmUP8HcrscTg">