aboutsummaryrefslogtreecommitdiff
path: root/gcc/config
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2019-05-20 09:55:00 +0200
committerMartin Liska <marxin@gcc.gnu.org>2019-05-20 07:55:00 +0000
commitdb91c7cf3d97a169d4e1c463d87a9f2007c40761 (patch)
tree11aa3bde6da1520b48d1a2a0cbf8e580e67e0c11 /gcc/config
parent03105885b1502a971955908255c722df5be0dafd (diff)
downloadgcc-db91c7cf3d97a169d4e1c463d87a9f2007c40761.zip
gcc-db91c7cf3d97a169d4e1c463d87a9f2007c40761.tar.gz
gcc-db91c7cf3d97a169d4e1c463d87a9f2007c40761.tar.bz2
Come up with hook libc_has_fast_function (PR middle-end/90263).
2019-05-20 Martin Liska <mliska@suse.cz> PR middle-end/90263 * builtins.c (expand_builtin_memory_copy_args): When having a target with fast mempcpy implementation do now use memcpy. * config/i386/i386.c (ix86_libc_has_fast_function): New. (TARGET_LIBC_HAS_FAST_FUNCTION): Likewise. * doc/tm.texi: Likewise. * doc/tm.texi.in: Likewise. * target.def: * expr.c (emit_block_move_hints): Add 2 new arguments. * expr.h (emit_block_move_hints): Bail out when libcall to memcpy would be used. 2019-05-20 Martin Liska <mliska@suse.cz> PR middle-end/90263 * gcc.c-torture/compile/pr90263.c: New test. * lib/target-supports.exp: Add check_effective_target_glibc. From-SVN: r271400
Diffstat (limited to 'gcc/config')
-rw-r--r--gcc/config/i386/i386.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index d3eb7c8..384c633 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -23063,6 +23063,21 @@ ix86_run_selftests (void)
#define TARGET_GET_MULTILIB_ABI_NAME \
ix86_get_multilib_abi_name
+static bool ix86_libc_has_fast_function (int fcode)
+{
+#ifdef OPTION_GLIBC
+ if (OPTION_GLIBC)
+ return (built_in_function)fcode == BUILT_IN_MEMPCPY;
+ else
+ return false;
+#else
+ return false;
+#endif
+}
+
+#undef TARGET_LIBC_HAS_FAST_FUNCTION
+#define TARGET_LIBC_HAS_FAST_FUNCTION ix86_libc_has_fast_function
+
#if CHECKING_P
#undef TARGET_RUN_TARGET_SELFTESTS
#define TARGET_RUN_TARGET_SELFTESTS selftest::ix86_run_selftests