On 10/19/2011 05:43 PM, Andrew MacLeod wrote:
> * optabs.h (direct_optab_index): Replace DOI_atomic_compare_exchange
> with DOI_atomic_compare_and_swap.
> (direct_op): Add DOI_atomic_compare_and_swap.
> * genopinit.c: Set atomic_compare_and_swap_optab.
> * expr.h (expand_atomic_compare_exchange): Add parameter.
> * builtins.c (builtin_atomic_compare_exchange): Add weak parameter
> and verify it is a compile time constant.
> * optabs.c (expand_atomic_compare_exchange): Use atomic_compare_and_swap
> if present, otherwise use __sync_val_compare_and_swap.
> * builtin-types.def (BT_FN_BOOL_VPTR_PTR_I{1,2,4,8,16}_BOOL_INT_INT):
> Add the bool parameter.
> * sync-builtins.def (BUILT_IN_ATOMIC_COMPARE_EXCHANGE_*): Use new
> prototype.
>
> * c-family/c-common.c (resolve_overloaded_builtin): Don't try to
> process a return value with an error mark.
>
> * libstdc++-v3/include/bits/atomic_2.h: Use __atomic_compare_exchange.
>
> * fortran/types.def (BT_FN_BOOL_VPTR_PTR_I{1,2,4,8,16}_BOOL_INT_INT):
> Add the bool parameter.
>
> * testsuite/gcc.dg/atomic-invalid.c: Add compare_exchange failures.
> * testsuite/gcc.dg/atomic-compare-exchange-{1-5}.c: New tests.
Ok.
r~