diff options
author | amacleod <amacleod@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-11-10 20:38:33 +0000 |
---|---|---|
committer | amacleod <amacleod@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-11-10 20:38:33 +0000 |
commit | 10b744a37ff1abbecf121987f694e0a704b77b95 (patch) | |
tree | 4138d94b9a849ba000843310e148fa8a6d8d6c8a /gcc/sync-builtins.def | |
parent | 5335e796aebf8ae6b08f8a8c664759c706e10653 (diff) | |
download | gcc-10b744a37ff1abbecf121987f694e0a704b77b95.tar.gz |
PR middle-end/51038
libstdc++-v3
* include/bits/atomic_base.h (atomic_thread_fence): Call built-in.
(atomic_signal_fence): Call built-in.
(test_and_set, clear): Call new atomic built-ins.
gcc
* builtins.c (expand_builtin_atomic_clear): New. Expand atomic_clear.
(expand_builtin_atomic_test_and_set): New. Expand atomic test_and_set.
(expand_builtin): Add cases for test_and_set and clear.
* sync-builtins.def (BUILT_IN_ATOMIC_TEST_AND_SET): New.
(BUILT_IN_ATOMIC_CLEAR): New.
testsuite
* gcc.dg/atomic-invalid.c: Add test for invalid __atomic_clear models.
* gcc.dg/atomic-flag.c: New. Test __atomic_test_and_set and
__atomic_clear.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@181271 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/sync-builtins.def')
-rw-r--r-- | gcc/sync-builtins.def | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/sync-builtins.def b/gcc/sync-builtins.def index 1a2df9ac018..15ff479bb5e 100644 --- a/gcc/sync-builtins.def +++ b/gcc/sync-builtins.def @@ -259,6 +259,12 @@ DEF_SYNC_BUILTIN (BUILT_IN_SYNC_SYNCHRONIZE, "__sync_synchronize", /* __sync* builtins for the C++ memory model. */ +DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_TEST_AND_SET, "__atomic_test_and_set", + BT_FN_BOOL_VPTR_INT, ATTR_NOTHROW_LEAF_LIST) + +DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_CLEAR, "__atomic_clear", BT_FN_VOID_VPTR_INT, + ATTR_NOTHROW_LEAF_LIST) + DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_EXCHANGE, "__atomic_exchange", BT_FN_VOID_SIZE_VPTR_PTR_PTR_INT, ATTR_NOTHROW_LEAF_LIST) |