http://llvm.org/bugs/show_bug.cgi?id=20546

            Bug ID: 20546
           Summary: atomic_compare_exchange_weak tests fail spuriously
           Product: libc++
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]
    Classification: Unclassified

So far I've only seen this on ARM, but it looks like it's actually an error in
the tests rather than the implementation.

According to 29.6.5.25:

"Remark: A weak compare-and-exchange operation may fail spuriously. That is,
even when the contents of memory referred to by expected and object are equal,
it may return false and store back to expected the same memory contents that
were originally there. [ Note: This spurious failure enables implementation of
compare and-exchange on a broader class of machines, e.g., load-locked
store-conditional machines. A consequence of spurious failure is that nearly
all uses of weak compare-and-exchange will be in a loop"

Our tests have these calls used outside of a loop.

Two examples:
test/atomics/atomics.types.generic/integral.pass.cpp
test/atomics/atomics.types.operations/atomics.types.operations.req/atomic_compare_exchange_weak.pass.cpp

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to