<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><span class="vcard"><a class="email" href="mailto:spatel+llvm@rotateright.com" title="Sanjay Patel <spatel+llvm@rotateright.com>"> <span class="fn">Sanjay Patel</span></a>
</span> changed
<a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED INVALID - Incorrect code is generated for rotation of 32-bit value to 32-bits"
href="https://bugs.llvm.org/show_bug.cgi?id=41875">bug 41875</a>
<br>
<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>What</th>
<th>Removed</th>
<th>Added</th>
</tr>
<tr>
<td style="text-align:right;">Resolution</td>
<td>---
</td>
<td>INVALID
</td>
</tr>
<tr>
<td style="text-align:right;">CC</td>
<td>
</td>
<td>spatel+llvm@rotateright.com
</td>
</tr>
<tr>
<td style="text-align:right;">Status</td>
<td>NEW
</td>
<td>RESOLVED
</td>
</tr></table>
<p>
<div>
<b><a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED INVALID - Incorrect code is generated for rotation of 32-bit value to 32-bits"
href="https://bugs.llvm.org/show_bug.cgi?id=41875#c1">Comment # 1</a>
on <a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED INVALID - Incorrect code is generated for rotation of 32-bit value to 32-bits"
href="https://bugs.llvm.org/show_bug.cgi?id=41875">bug 41875</a>
from <span class="vcard"><a class="email" href="mailto:spatel+llvm@rotateright.com" title="Sanjay Patel <spatel+llvm@rotateright.com>"> <span class="fn">Sanjay Patel</span></a>
</span></b>
<pre>The function invokes undefined behavior, so anything is possible.
You can test for that by adding a 'main' wrapper and:
$ clang -fsanitize=undefined 41875.c
$ ./a.out
41875.c:9:14: runtime error: shift exponent 32 is too large for 32-bit type
'uint32_t' (aka 'unsigned int')
For safe code and likely better code optimization, you may want to use the
clang builtins for bitwise rotation:
<a href="https://clang.llvm.org/docs/LanguageExtensions.html#builtin-functions">https://clang.llvm.org/docs/LanguageExtensions.html#builtin-functions</a></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>