Both of the tests under 128 bit are raising:

warning: writing 16 bytes into a region of size 8 [-Wstringop-overflow=]

when compiling, leading to a test fail. The warning is caused by the
incorrect array size for res_ref2. The wrong size caused the overflow.

Correct them in this patch to fix the test fail.

Ok for trunk?

Thx,
Haochen

gcc/testsuite/ChangeLog:

        * gcc.target/i386/avx512bw-vpmovuswb-2.c: Correct res_ref2
        array size.
        * gcc.target/i386/avx512bw-vpmovwb-2.c: Ditto.
---
 gcc/testsuite/gcc.target/i386/avx512bw-vpmovuswb-2.c | 2 +-
 gcc/testsuite/gcc.target/i386/avx512bw-vpmovwb-2.c   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/gcc/testsuite/gcc.target/i386/avx512bw-vpmovuswb-2.c 
b/gcc/testsuite/gcc.target/i386/avx512bw-vpmovuswb-2.c
index d5198f39eb6..2311dfea34f 100644
--- a/gcc/testsuite/gcc.target/i386/avx512bw-vpmovuswb-2.c
+++ b/gcc/testsuite/gcc.target/i386/avx512bw-vpmovuswb-2.c
@@ -27,7 +27,7 @@ TEST (void)
   UNION_TYPE (AVX512F_LEN, i_w) src;
   MASK_TYPE mask = MASK_VALUE;
   unsigned char res_ref[32];
-  unsigned char res_ref2[SIZE];
+  unsigned char res_ref2[SIZE_HALF];
 
   for (i = 0; i < SIZE; i++)
     {
diff --git a/gcc/testsuite/gcc.target/i386/avx512bw-vpmovwb-2.c 
b/gcc/testsuite/gcc.target/i386/avx512bw-vpmovwb-2.c
index 6b0f86f57d8..ea91181284f 100644
--- a/gcc/testsuite/gcc.target/i386/avx512bw-vpmovwb-2.c
+++ b/gcc/testsuite/gcc.target/i386/avx512bw-vpmovwb-2.c
@@ -28,7 +28,7 @@ TEST (void)
   UNION_TYPE (AVX512F_LEN, i_w) src;
   MASK_TYPE mask = MASK_VALUE;
   char res_ref[32];
-  char res_ref2[SIZE];
+  char res_ref2[SIZE_HALF];
 
   sign = -1;
   for (i = 0; i < SIZE; i++)
-- 
2.31.1

Reply via email to