<html>
<head>
<base href="https://bugs.freedesktop.org/">
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - Incorrect code generation for atomic operations if HAVE_INTEL_ATOMIC_PRIMITIVES defined"
href="https://bugs.freedesktop.org/show_bug.cgi?id=103559#c3">Comment # 3</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - Incorrect code generation for atomic operations if HAVE_INTEL_ATOMIC_PRIMITIVES defined"
href="https://bugs.freedesktop.org/show_bug.cgi?id=103559">bug 103559</a>
from <span class="vcard"><a class="email" href="mailto:fludkov.me@gmail.com" title="Mikhail Fludkov <fludkov.me@gmail.com>"> <span class="fn">Mikhail Fludkov</span></a>
</span></b>
<pre>(In reply to Adrian Johnson from <a href="show_bug.cgi?id=103559#c2">comment #2</a>)
<span class="quote">> I would just use __sync_fetch_and_add(x, 0) for the get. The C++11 atomics
> were added in gcc 4.7 (about 5 years ago). Anyone caring about speed should
> be using a recent version of gcc.</span >
Agree it will be explicit and less "magical". What about using the same
implementation regardless of ATOMIC_OP_NEEDS_MEMORY_BARRIER define?
The naming is a bit confusing though. When I read HAVE_INTEL_ATOMIC_PRIMITIVES
define, I immediately thought about Intel Compiler and the libraries that come
with it. Maybe HAVE_GCC_41_ATOMICS, or HAVE_GCC_OLD_ATOMICS names are better?
<span class="quote">> What version of gcc were you using? Maybe the old versions that don't
> support C++11 atomics do not optimize away the read.</span >
We backported the patch (<a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED FIXED - Segmentation fault in _cairo_traps_compositor_glyphs"
href="show_bug.cgi?id=103037">https://bugs.freedesktop.org/show_bug.cgi?id=103037</a>)
on top of libcairo version which didn't have the code under
HAVE_CXX11_ATOMIC_PRIMITIVES define. Compiled with gcc 4.9, ended up with a hot
loop.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the QA Contact for the bug.</li>
</ul>
</body>
</html>