diff options
author | Andrew Pinski <quic_apinski@quicinc.com> | 2025-04-18 20:28:40 -0700 |
---|---|---|
committer | Andrew Pinski <quic_apinski@quicinc.com> | 2025-04-19 08:06:26 -0700 |
commit | 52d7676cb4b998521c88691474ed2616226eaa73 (patch) | |
tree | c3858a4978d6b37ae5d761b4778b6564f77b84da /gcc | |
parent | 0939abea33ce9d9eb9328f80aace8109c096760c (diff) | |
download | gcc-52d7676cb4b998521c88691474ed2616226eaa73.zip gcc-52d7676cb4b998521c88691474ed2616226eaa73.tar.gz gcc-52d7676cb4b998521c88691474ed2616226eaa73.tar.bz2 |
Fix pr118947-1.c and pr78408-3.c on targets where 32 bytes memcpy uses a vector
The problem here is on targets where a 32byte memcpy will use an integral (vector) type
to do the copy and the code will be optimized a different way than expected. This changes
the testcase instead to use a size of 1025 to make sure there is no target that will use an
integral (vector) type for the memcpy and be optimized via the method that was just added.
Pushed as obvious after a test run.
gcc/testsuite/ChangeLog:
* gcc.dg/pr118947-1.c: Use 1025 as the size of the buf.
* gcc.dg/pr78408-3.c: Likewise.
Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/gcc.dg/pr118947-1.c | 4 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/pr78408-3.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/gcc/testsuite/gcc.dg/pr118947-1.c b/gcc/testsuite/gcc.dg/pr118947-1.c index 70b7f80..8733e8d 100644 --- a/gcc/testsuite/gcc.dg/pr118947-1.c +++ b/gcc/testsuite/gcc.dg/pr118947-1.c @@ -6,10 +6,10 @@ void* aaa(); void* bbb() { - char buf[32] = {}; + char buf[1025] = {}; /* Tha call to aaa should not matter and clobber buf. */ void* ret = aaa(); - __builtin_memcpy(ret, buf, 32); + __builtin_memcpy(ret, buf, sizeof(buf)); return ret; } diff --git a/gcc/testsuite/gcc.dg/pr78408-3.c b/gcc/testsuite/gcc.dg/pr78408-3.c index 3de90d0..5ea5458 100644 --- a/gcc/testsuite/gcc.dg/pr78408-3.c +++ b/gcc/testsuite/gcc.dg/pr78408-3.c @@ -7,8 +7,8 @@ void* aaa(); void* bbb() { void* ret = aaa(); - char buf[32] = {}; - __builtin_memcpy(ret, buf, 32); + char buf[1025] = {}; + __builtin_memcpy(ret, buf, sizeof(buf)); return ret; } |