[PATCH] testsuite/97204 - fix gcc.target/i386/sse2-mmx-pinsrw.c

Richard Biener rguenther@suse.de
Fri Sep 25 09:45:27 GMT 2020


This fixes the testcase writing to adjacent stack vars, exposed
my IPA modref.

Tested on x86_64-unknown-linux-gnu, pushed.

2020-09-25  Richard Biener  <rguenther@suse.de>

	PR testsuite/97204
	* gcc.target/i386/sse2-mmx-pinsrw.c: Fix.
---
 gcc/testsuite/gcc.target/i386/sse2-mmx-pinsrw.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/gcc/testsuite/gcc.target/i386/sse2-mmx-pinsrw.c b/gcc/testsuite/gcc.target/i386/sse2-mmx-pinsrw.c
index c25ddd96daa..fd933555913 100644
--- a/gcc/testsuite/gcc.target/i386/sse2-mmx-pinsrw.c
+++ b/gcc/testsuite/gcc.target/i386/sse2-mmx-pinsrw.c
@@ -42,7 +42,7 @@ compute_correct_result (__m64 *src_p, int val, unsigned int imm,
 static void
 sse2_test (void)
 {
-  int r, ck;
+  int r[2], ck[2];
   int i;
   int failed = 0;
   __v4hi y = { 3320, -3339, 48, 4392 };
@@ -50,9 +50,9 @@ sse2_test (void)
   /* Run the MMX tests */
   for (i = 0; i < 4; i++)
     {
-      test_pinsrw  ((__m64 *) &y, 0x1234, i, &r);
-      compute_correct_result ((__m64 *) &y, 0x1234, i, &ck);
-      if (r != ck)
+      test_pinsrw  ((__m64 *) &y, 0x1234, i, r);
+      compute_correct_result ((__m64 *) &y, 0x1234, i, ck);
+      if (r[0] != ck[0] || r[1] != ck[1])
 	failed++;
     }
 
-- 
2.26.2


More information about the Gcc-patches mailing list