<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><span class="vcard"><a class="email" href="mailto:avg@FreeBSD.org" title="Andriy Gapon <avg@FreeBSD.org>"> <span class="fn">Andriy Gapon</span></a>
</span> changed
<a class="bz_bug_link
bz_status_REOPENED "
title="REOPENED - clang can miscompile code involving uninitialized value and xor-s"
href="https://bugs.llvm.org/show_bug.cgi?id=36610">bug 36610</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;">Status</td>
<td>RESOLVED
</td>
<td>REOPENED
</td>
</tr>
<tr>
<td style="text-align:right;">Resolution</td>
<td>INVALID
</td>
<td>---
</td>
</tr></table>
<p>
<div>
<b><a class="bz_bug_link
bz_status_REOPENED "
title="REOPENED - clang can miscompile code involving uninitialized value and xor-s"
href="https://bugs.llvm.org/show_bug.cgi?id=36610#c8">Comment # 8</a>
on <a class="bz_bug_link
bz_status_REOPENED "
title="REOPENED - clang can miscompile code involving uninitialized value and xor-s"
href="https://bugs.llvm.org/show_bug.cgi?id=36610">bug 36610</a>
from <span class="vcard"><a class="email" href="mailto:avg@FreeBSD.org" title="Andriy Gapon <avg@FreeBSD.org>"> <span class="fn">Andriy Gapon</span></a>
</span></b>
<pre>Also, a counter-example or, rather, an example of Clang being inconsistent:
uint32_t
combine(uint16_t x, uint16_t y)
{
uint32_t r;
r &= 0xffff0000u;
r |= x;
r &= 0x0000ffffu;
r |= (uint32_t)y << 16;
return (r);
}
This code is compiled correctly.
In this statement
r = r & 0xffff0000u;
there is an access to unspecified value, so Clang was free to deem it the
undefined behavior, which it didn't.
I do not see any dramatic difference from the code using xor.
So, I still think that Clang has a problem reasoning about xor.</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>