<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </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 --- - __GCC_ATOMIC_LLONG_LOCK_FREE only set to 1 on X86"
   href="http://llvm.org/bugs/show_bug.cgi?id=19355">19355</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>__GCC_ATOMIC_LLONG_LOCK_FREE only set to 1 on X86
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>3.4
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </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>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>LLVM Codegen
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>gjasny@googlemail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Hello,

when compiling the Boost Atomic library I noticed a test case failure which
expects that boost::atomic<long long> is always lock-free on X86 [1].

This is caused by the fact that clang sets the __GCC_ATOMIC_LLONG_LOCK_FREE to
1.
In comparison gcc (4.8) sets this preprocessor symbol to 2:

$ gcc --version
gcc (Debian 4.8.2-19) 4.8.2
$ gcc -dM -E - -m32 < /dev/null|grep __GCC_ATOMIC_LLONG_LOCK_FREE
#define __GCC_ATOMIC_LLONG_LOCK_FREE 2

In contrast:

$ clang --version
Debian clang version 3.4-2 (tags/RELEASE_34/final) (based on LLVM 3.4)
Target: x86_64-pc-linux-gnu
Thread model: posix
$ clang -dM -E - -m32 < /dev/null|grep __GCC_ATOMIC_LLONG_LOCK_FREE
#define __GCC_ATOMIC_LLONG_LOCK_FREE 1

Is this difference a bug? Andrey Semashev stated in the Boost Atomic bug report
that Core2 CPUs all should support cmpxchg8b and thus be always completely lock
free.

Thanks,
Gregor

[1] See <a href="https://svn.boost.org/trac/boost/ticket/9842">https://svn.boost.org/trac/boost/ticket/9842</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>