<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - Incorrect code is generated for rotation of 32-bit value to 32-bits"
href="https://bugs.llvm.org/show_bug.cgi?id=41875">41875</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Incorrect code is generated for rotation of 32-bit value to 32-bits
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>8.0
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>-New Bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>esolosh@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org, neeilans@live.com, richard-llvm@metafoo.co.uk
</td>
</tr></table>
<p>
<div>
<pre>I'm using <a href="https://clang.godbolt.org/">https://clang.godbolt.org/</a> with the following settings:
Compiler: x86-64 clang 8.0.0
Options: -Os
Test code:
```
#include <stdint.h>
extern uint32_t v32;
void rotate_32 (void)
{
uint32_t x = v32;
int n = 32;
v32 = (x >> n) | (x << (32 - n)); /* rotate right to 32-bits */
}
```
Disassembly:
```
rotate_32: # @rotate_32
mov dword ptr [rip + v32], -1
ret
```
I expect that value in v32 does not change, but -1 is loaded instead.
Also can be observed with other clang version and other optimization levels
(-O1, -O2, -O3).</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>