<html>
<head>
<base href="https://llvm.org/bugs/" />
</head>
<body><span class="vcard"><a class="email" href="mailto:richard-llvm@metafoo.co.uk" title="Richard Smith <richard-llvm@metafoo.co.uk>"> <span class="fn">Richard Smith</span></a>
</span> changed
<a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED INVALID - undefined reference to `__atomic_load_8', when it comes to 64-bit atomic load."
href="https://llvm.org/bugs/show_bug.cgi?id=23262">bug 23262</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>NEW
</td>
<td>RESOLVED
</td>
</tr>
<tr>
<td style="text-align:right;">CC</td>
<td>
</td>
<td>richard-llvm@metafoo.co.uk
</td>
</tr>
<tr>
<td style="text-align:right;">Resolution</td>
<td>---
</td>
<td>INVALID
</td>
</tr></table>
<p>
<div>
<b><a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED INVALID - undefined reference to `__atomic_load_8', when it comes to 64-bit atomic load."
href="https://llvm.org/bugs/show_bug.cgi?id=23262#c2">Comment # 2</a>
on <a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED INVALID - undefined reference to `__atomic_load_8', when it comes to 64-bit atomic load."
href="https://llvm.org/bugs/show_bug.cgi?id=23262">bug 23262</a>
from <span class="vcard"><a class="email" href="mailto:richard-llvm@metafoo.co.uk" title="Richard Smith <richard-llvm@metafoo.co.uk>"> <span class="fn">Richard Smith</span></a>
</span></b>
<pre>GCC miscompiled your code. Note that this instruction:
movq terms(%rip), %rax
is *not* atomic, if terms happens to straddle a cache line, which it might
because it has only 4 byte alignment and has size 8.
You should add alignas(8) to your "struct Terms" to work around libstdc++
failing to align std::atomic<T> properly.
Oddly, while x86 does not have a misaligned 8 byte load instruction, it does
have a misaligned 8-byte compare-exchange instruction (lock cmpxchgq), but LLVM
is unable to represent a misaligned cmpxchg, so we won't emit that.</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>