After the change r249278. bcopy is folded into memmove. And in newlib
aarch64 memmove implementation, it will call memcpy in certain conditions.
The memcpy defined in memops-asm-lib.c will abort when the test is running.
A user defined memmove function is defined to bypass the library one.
So that memcpy won't be called accidentally.
gcc/testsuite/
* gcc.c-torture/execute/builtins/memops-asm-lib.c (my_memmove): New.
* gcc.c-torture/execute/builtins/memops-asm.c (memmove): Declare memmove.
Co-Authored-By: Szabolcs Nagy <szabolcs.nagy@arm.com>
From-SVN: r249647
+2017-06-26 Renlin Li <renlin.li@arm.com>
+ Szabolcs Nagy <szabolcs.nagy@arm.com>
+
+ * gcc.c-torture/execute/builtins/memops-asm-lib.c (my_memmove): New.
+ * gcc.c-torture/execute/builtins/memops-asm.c (memmove): Declare
+ memmove.
+
2017-06-26 Richard Biener <rguenther@suse.de>
PR target/81175
}
}
+__attribute__ ((used))
+void
+my_memmove (void *d, const void *s, size_t n)
+{
+ char *dst = (char *) d;
+ const char *src = (const char *) s;
+ if (src >= dst)
+ while (n--)
+ *dst++ = *src++;
+ else
+ {
+ dst += n;
+ src += n;
+ while (n--)
+ *--dst = *--src;
+ }
+}
+
/* LTO code is at the present to able to track that asm alias my_bcopy on builtin
actually refers to this function. See PR47181. */
__attribute__ ((used))
__asm (ASMNAME ("my_memcpy"));
extern void bcopy (const void *, void *, size_t)
__asm (ASMNAME ("my_bcopy"));
+extern void *memmove (void *, const void *, size_t)
+ __asm (ASMNAME ("my_memmove"));
extern void *memset (void *, int, size_t)
__asm (ASMNAME ("my_memset"));
extern void bzero (void *, size_t)