https://gcc.gnu.org/g:595bc6263adaa7a172b899db8381479bc50fd083

commit r16-3454-g595bc6263adaa7a172b899db8381479bc50fd083
Author: Andrew Pinski <andrew.pin...@oss.qualcomm.com>
Date:   Thu Aug 28 22:38:19 2025 -0700

    i386: Fix vect-pragma-target-[12].c testcase for -march=XYZ [PR120643]
    
    These 2 testcases were originally designed for the default -march= of
    x86_64 so if you pass -march=native (on a target with AVX512 enabled),
    they will fail. It fix this, we add `-mno-sse3 -mtune=generic`
    to the options to force a specific arch to the testcase.
    
    Changes since v1:
    * v2: Use -mtune=generic instead of -mprefer-vector-width=512.
    
    Tested on a skylake-avx512 machine with -march=native.
    
            PR testsuite/120643
    gcc/testsuite/ChangeLog:
    
            * gcc.target/i386/vect-pragma-target-1.c: Add `-mno-sse3 
-mtune=generic`
            to the options.
            * gcc.target/i386/vect-pragma-target-2.c: Likewise.
    
    Signed-off-by: Andrew Pinski <andrew.pin...@oss.qualcomm.com>

Diff:
---
 gcc/testsuite/gcc.target/i386/vect-pragma-target-1.c | 2 +-
 gcc/testsuite/gcc.target/i386/vect-pragma-target-2.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/gcc/testsuite/gcc.target/i386/vect-pragma-target-1.c 
b/gcc/testsuite/gcc.target/i386/vect-pragma-target-1.c
index f5e71e453ec1..58ff7f07a092 100644
--- a/gcc/testsuite/gcc.target/i386/vect-pragma-target-1.c
+++ b/gcc/testsuite/gcc.target/i386/vect-pragma-target-1.c
@@ -1,5 +1,5 @@
 /* { dg-do compile { target { i?86-*-* x86_64-*-* } } }                 */
-/* { dg-options "-O0" }                                                 */
+/* { dg-options "-O0 -mno-sse3 -mtune=generic" }                        */
 /* { dg-final { scan-assembler-times "paddd.+xmm\[0-9]+"        1 } }   */
 /* { dg-final { scan-assembler-times "vfmadd132ps.+ymm\[0-9]+"  1 } }   */
 /* { dg-final { scan-assembler-times "vpaddw.+zmm\[0-9]+"       1 } }   */
diff --git a/gcc/testsuite/gcc.target/i386/vect-pragma-target-2.c 
b/gcc/testsuite/gcc.target/i386/vect-pragma-target-2.c
index 349680453a49..f6dbd54e8002 100644
--- a/gcc/testsuite/gcc.target/i386/vect-pragma-target-2.c
+++ b/gcc/testsuite/gcc.target/i386/vect-pragma-target-2.c
@@ -1,5 +1,5 @@
 /* { dg-do compile { target { i?86-*-* x86_64-*-* } } }                 */
-/* { dg-options "-O0" }                                                 */
+/* { dg-options "-O0 -mno-sse3 -mtune=generic" }                        */
 /* { dg-final { scan-assembler-times "paddd.+xmm\[0-9]+"        1 } }   */
 /* { dg-final { scan-assembler-times "vfmadd132ps.+ymm\[0-9]+"  1 } }   */
 /* { dg-final { scan-assembler-times "vpaddw.+zmm\[0-9]+"       1 } }   */

Reply via email to