<html>
    <head>
      <base href="https://bugs.freedesktop.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 generation for atomic operations if HAVE_INTEL_ATOMIC_PRIMITIVES defined"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=103559">103559</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Incorrect code generation for atomic operations if HAVE_INTEL_ATOMIC_PRIMITIVES defined
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>cairo
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </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>medium
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>general
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>chris@chris-wilson.co.uk
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>fludkov.me@gmail.com
          </td>
        </tr>

        <tr>
          <th>QA Contact</th>
          <td>cairo-bugs@cairographics.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>It is a follow up after <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>.
The patch has the loop:
    while (_cairo_atomic_int_get(once) != CAIRO_ATOMIC_ONCE_INITIALIZED) {}

When the library is compiled with HAVE_INTEL_ATOMIC_PRIMITIVES:
    /* whether memory barriers are needed around atomic operations */
    /* #undef ATOMIC_OP_NEEDS_MEMORY_BARRIER */
    ...
    #define HAVE_INTEL_ATOMIC_PRIMITIVES 1

The _cairo_atomic_int_get will be defined as:
   # define _cairo_atomic_int_get(x) (*x)

Which will make this loop to hot-loop forever, because gcc will optimize it and
read once instead of reading on every loop iteration.

Does anybody actually use the implementation under HAVE_INTEL_ATOMIC_PRIMITIVES
define? According to git history, the code under HAVE_CXX11_ATOMIC_PRIMITIVES
define landed after the one HAVE_INTEL_ATOMIC_PRIMITIVES. But should not it
have completely replaced it?</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>