From: Chung-Lin Tang Date: Thu, 17 Nov 2016 06:26:56 +0000 (+0000) Subject: re PR target/78357 (nios2 uses non-standard atomic functions) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9bd99cce5b3769fd98b3db0d858222fa67e56486;p=gcc.git re PR target/78357 (nios2 uses non-standard atomic functions) 2016-11-17 Chung-Lin Tang PR target/78357 * config/nios2/nios2.c (nios2_init_libfuncs): Remove TARGET_LINUX_ABI condition. (TARGET_INIT_LIBFUNCS): Delete definition and... * config/nios2/linux.h (TARGET_INIT_LIBFUNCS): ...move to here, add comments. From-SVN: r242534 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7a7d6e61cad..c1c5b8bff48 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2016-11-17 Chung-Lin Tang + + PR target/78357 + * config/nios2/nios2.c (nios2_init_libfuncs): Remove TARGET_LINUX_ABI + condition. + (TARGET_INIT_LIBFUNCS): Delete definition and... + * config/nios2/linux.h (TARGET_INIT_LIBFUNCS): ...move to here, add + comments. + 2016-11-17 Krister Walfridsson * config/netbsd-stdint.h: New. diff --git a/gcc/config/nios2/linux.h b/gcc/config/nios2/linux.h index 4ef55b58886..7b9e59ae96a 100644 --- a/gcc/config/nios2/linux.h +++ b/gcc/config/nios2/linux.h @@ -44,3 +44,7 @@ Nios II Processor Reference Handbook. */ #define TARGET_LINUX_ABI 1 +/* For Linux, we have access to kernel support for atomic operations, + add initialization for __sync_* builtins. */ +#undef TARGET_INIT_LIBFUNCS +#define TARGET_INIT_LIBFUNCS nios2_init_libfuncs diff --git a/gcc/config/nios2/nios2.c b/gcc/config/nios2/nios2.c index 2a28fadcdb0..b8e21fb18b2 100644 --- a/gcc/config/nios2/nios2.c +++ b/gcc/config/nios2/nios2.c @@ -3607,9 +3607,7 @@ nios2_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED, static void nios2_init_libfuncs (void) { - /* For Linux, we have access to kernel support for atomic operations. */ - if (TARGET_LINUX_ABI) - init_sync_libfuncs (UNITS_PER_WORD); + init_sync_libfuncs (UNITS_PER_WORD); } @@ -4986,9 +4984,6 @@ nios2_adjust_reg_alloc_order (void) #undef TARGET_BUILTIN_DECL #define TARGET_BUILTIN_DECL nios2_builtin_decl -#undef TARGET_INIT_LIBFUNCS -#define TARGET_INIT_LIBFUNCS nios2_init_libfuncs - #undef TARGET_FUNCTION_OK_FOR_SIBCALL #define TARGET_FUNCTION_OK_FOR_SIBCALL hook_bool_tree_tree_true