This test is designed to check that if one of the operands is
aligned (but the other isn't) we expand to a sensible sequence and
bypass most of the overhead of doing a memcpy.  But on targets without
unaligned accessess, we still end up calling memcpy.  It's then a
lottery as to whether the prologue and epilogue code, plus the
set-up for the memcpy itself, generate instructions that match the
scan patterns.

Since in those cases we're not actually testing what the test is looking
for anyway, just skip the test on strict-alignment targets.

gcc/testsuite:
        * gcc.target/arm/memcpy-aligned-1.c: Require unaligned accesses.
---
 gcc/testsuite/gcc.target/arm/memcpy-aligned-1.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gcc/testsuite/gcc.target/arm/memcpy-aligned-1.c 
b/gcc/testsuite/gcc.target/arm/memcpy-aligned-1.c
index 852b391388b..42e2a6bbdf7 100644
--- a/gcc/testsuite/gcc.target/arm/memcpy-aligned-1.c
+++ b/gcc/testsuite/gcc.target/arm/memcpy-aligned-1.c
@@ -1,4 +1,5 @@
 /* { dg-do compile } */
+/* { dg-require-effective-target arm_unaligned } */
 /* { dg-options "-O2 -save-temps" } */
 
 void *memcpy (void *dest, const void *src, unsigned int n);
-- 
2.34.1

Reply via email to