mirror of
https://gcc.gnu.org/git/gcc.git
synced 2024-12-12 05:13:50 +08:00
c29c36ad5d
PR c/65083 notes that some functions in <stdatomic.h> are normal functions, not generic functions, and so need to have out-of-line copies that can be called when macro expansion is suppressed (unlike the generic functions where DR#419 makes it undefined if you suppress a macro expansion). This patch adds such out-of-line definitions in libatomic for those six functions, at a new LIBATOMIC_1.2 symbol version, as trivial wrappers to the <stdatomic.h> macros, along with declarations of those functions in <stdatomic.h>. Tests are added that are based on the corresponding tests for the macros, but with parentheses around the function names to force the out-of-line functions to be used. Bootstrapped with no regressions on x86_64-pc-linux-gnu. gcc: * ginclude/stdatomic.h (atomic_thread_fence, atomic_signal_fence) (atomic_flag_test_and_set, atomic_flag_test_and_set_explicit) (atomic_flag_clear, atomic_flag_clear_explicit): Declare as functions before defining as macros. gcc/testsuite: * gcc.dg/atomic/stdatomic-fence-2.c, gcc.dg/atomic/stdatomic-flag-2.c: New tests. libatomic: * fence.c, flag.c: New files. * Makefile.am (libatomic_la_SOURCES): Add fence.c and flag.c. * Makefile.in: Regenerate. * configure.ac (libtool_VERSION): Change to 3:0:2. * configure: Regenerate. * libatomic.map (LIBATOMIC_1.2): New symbol version. From-SVN: r230578
111 lines
2.3 KiB
Plaintext
111 lines
2.3 KiB
Plaintext
LIBATOMIC_1.0 {
|
|
global:
|
|
__atomic_load;
|
|
__atomic_store;
|
|
__atomic_exchange;
|
|
__atomic_compare_exchange;
|
|
__atomic_is_lock_free;
|
|
|
|
__atomic_add_fetch_1;
|
|
__atomic_add_fetch_2;
|
|
__atomic_add_fetch_4;
|
|
__atomic_add_fetch_8;
|
|
__atomic_add_fetch_16;
|
|
__atomic_and_fetch_1;
|
|
__atomic_and_fetch_2;
|
|
__atomic_and_fetch_4;
|
|
__atomic_and_fetch_8;
|
|
__atomic_and_fetch_16;
|
|
__atomic_compare_exchange_1;
|
|
__atomic_compare_exchange_2;
|
|
__atomic_compare_exchange_4;
|
|
__atomic_compare_exchange_8;
|
|
__atomic_compare_exchange_16;
|
|
__atomic_exchange_1;
|
|
__atomic_exchange_2;
|
|
__atomic_exchange_4;
|
|
__atomic_exchange_8;
|
|
__atomic_exchange_16;
|
|
__atomic_fetch_add_1;
|
|
__atomic_fetch_add_2;
|
|
__atomic_fetch_add_4;
|
|
__atomic_fetch_add_8;
|
|
__atomic_fetch_add_16;
|
|
__atomic_fetch_and_1;
|
|
__atomic_fetch_and_2;
|
|
__atomic_fetch_and_4;
|
|
__atomic_fetch_and_8;
|
|
__atomic_fetch_and_16;
|
|
__atomic_fetch_nand_1;
|
|
__atomic_fetch_nand_2;
|
|
__atomic_fetch_nand_4;
|
|
__atomic_fetch_nand_8;
|
|
__atomic_fetch_nand_16;
|
|
__atomic_fetch_or_1;
|
|
__atomic_fetch_or_2;
|
|
__atomic_fetch_or_4;
|
|
__atomic_fetch_or_8;
|
|
__atomic_fetch_or_16;
|
|
__atomic_fetch_sub_1;
|
|
__atomic_fetch_sub_2;
|
|
__atomic_fetch_sub_4;
|
|
__atomic_fetch_sub_8;
|
|
__atomic_fetch_sub_16;
|
|
__atomic_fetch_xor_1;
|
|
__atomic_fetch_xor_2;
|
|
__atomic_fetch_xor_4;
|
|
__atomic_fetch_xor_8;
|
|
__atomic_fetch_xor_16;
|
|
__atomic_load_1;
|
|
__atomic_load_2;
|
|
__atomic_load_4;
|
|
__atomic_load_8;
|
|
__atomic_load_16;
|
|
__atomic_nand_fetch_1;
|
|
__atomic_nand_fetch_2;
|
|
__atomic_nand_fetch_4;
|
|
__atomic_nand_fetch_8;
|
|
__atomic_nand_fetch_16;
|
|
__atomic_or_fetch_1;
|
|
__atomic_or_fetch_2;
|
|
__atomic_or_fetch_4;
|
|
__atomic_or_fetch_8;
|
|
__atomic_or_fetch_16;
|
|
__atomic_store_1;
|
|
__atomic_store_2;
|
|
__atomic_store_4;
|
|
__atomic_store_8;
|
|
__atomic_store_16;
|
|
__atomic_sub_fetch_1;
|
|
__atomic_sub_fetch_2;
|
|
__atomic_sub_fetch_4;
|
|
__atomic_sub_fetch_8;
|
|
__atomic_sub_fetch_16;
|
|
__atomic_test_and_set_1;
|
|
__atomic_test_and_set_2;
|
|
__atomic_test_and_set_4;
|
|
__atomic_test_and_set_8;
|
|
__atomic_test_and_set_16;
|
|
__atomic_xor_fetch_1;
|
|
__atomic_xor_fetch_2;
|
|
__atomic_xor_fetch_4;
|
|
__atomic_xor_fetch_8;
|
|
__atomic_xor_fetch_16;
|
|
|
|
local:
|
|
*;
|
|
};
|
|
LIBATOMIC_1.1 {
|
|
global:
|
|
__atomic_feraiseexcept;
|
|
} LIBATOMIC_1.0;
|
|
LIBATOMIC_1.2 {
|
|
global:
|
|
atomic_thread_fence;
|
|
atomic_signal_fence;
|
|
atomic_flag_test_and_set;
|
|
atomic_flag_test_and_set_explicit;
|
|
atomic_flag_clear;
|
|
atomic_flag_clear_explicit;
|
|
} LIBATOMIC_1.1;
|