@@ -1,6 +1,6 @@
/* Verify zero initialization for integer and pointer type automatic variables. */
/* { dg-do compile } */
-/* { dg-options "-ftrivial-auto-var-init=zero -fdump-rtl-expand" } */
+/* { dg-options "-ftrivial-auto-var-init=zero -fdump-rtl-expand -fno-stack-protector -march=x86-64 -mtune=generic" } */
#ifndef __cplusplus
# define bool _Bool
@@ -1,6 +1,6 @@
/* Verify pattern initialization for integer and pointer type automatic variables. */
/* { dg-do compile } */
-/* { dg-options "-ftrivial-auto-var-init=pattern -fdump-rtl-expand" } */
+/* { dg-options "-ftrivial-auto-var-init=pattern -fdump-rtl-expand -march=x86-64 -mtune=generic -msse" } */
#ifndef __cplusplus
# define bool _Bool
@@ -31,6 +31,8 @@ void foo()
/* { dg-final { scan-rtl-dump-times "0xfffffffffffffffe" 2 "expand" } } */
/* { dg-final { scan-rtl-dump-times "0xfffffffffffffefe" 1 "expand" } } */
-/* { dg-final { scan-rtl-dump-times "0xfffffffffefefefe" 2 "expand" } } */
-/* { dg-final { scan-rtl-dump-times "0xfefefefefefefefe" 3 "expand" } } */
+/* { dg-final { scan-rtl-dump-times "0xfffffffffefefefe" 2 "expand" { target lp64 } } } */
+/* { dg-final { scan-rtl-dump-times "0xfefefefefefefefe" 3 "expand" { target lp64 } } } */
+/* { dg-final { scan-rtl-dump-times "0xfffffffffefefefe" 4 "expand" { target ia32 } } } */
+/* { dg-final { scan-rtl-dump-times "0xfefefefefefefefe" 1 "expand" { target ia32 } } } */
@@ -1,6 +1,6 @@
/* Verify zero initialization for floating point type automatic variables. */
/* { dg-do compile } */
-/* { dg-options "-ftrivial-auto-var-init=zero" } */
+/* { dg-options "-ftrivial-auto-var-init=zero -march=x86-64 -mtune=generic" } */
long double result;
@@ -14,4 +14,5 @@ long double foo()
return result;
}
-/* { dg-final { scan-assembler-times "pxor\t\\\%xmm0, \\\%xmm0" 3 } } */
+/* { dg-final { scan-assembler-times "pxor\t\\\%xmm0, \\\%xmm0" 3 { target lp64 } } } */
+/* { dg-final { scan-assembler-times "fldz" 3 { target ia32} } } */
@@ -1,6 +1,6 @@
/* Verify pattern initialization for floating point type automatic variables. */
/* { dg-do compile } */
-/* { dg-options "-ftrivial-auto-var-init=pattern -fdump-rtl-expand" } */
+/* { dg-options "-ftrivial-auto-var-init=pattern -fdump-rtl-expand -march=x86-64 -mtune=generic -msse" } */
long double result;
@@ -14,7 +14,9 @@ long double foo()
return result;
}
-/* { dg-final { scan-rtl-dump-times "0xfffffffffefefefe" 1 "expand" } } */
-/* { dg-final { scan-rtl-dump-times "\\\[0xfefefefefefefefe\\\]" 1 "expand" } } */
-/* { dg-final { scan-rtl-dump-times "0xfffffffffffffffe\\\]\\\) repeated x16" 1 "expand" } } */
+/* { dg-final { scan-rtl-dump-times "0xfffffffffefefefe" 1 "expand" { target lp64 } } } */
+/* { dg-final { scan-rtl-dump-times "\\\[0xfefefefefefefefe\\\]" 1 "expand" { target lp64 } } } */
+/* { dg-final { scan-rtl-dump-times "0xfffffffffffffffe\\\]\\\) repeated x16" 1 "expand" { target lp64 } } } */
+/* { dg-final { scan-rtl-dump-times "0xfffffffffefefefe" 2 "expand" { target ia32 } } } */
+/* { dg-final { scan-rtl-dump-times "\\\[0xfefefefefefefefe\\\]" 2 "expand" { target ia32 } } } */
@@ -1,6 +1,6 @@
/* Verify zero initialization for complex type automatic variables. */
/* { dg-do compile } */
-/* { dg-options "-ftrivial-auto-var-init=zero -fdump-rtl-expand" } */
+/* { dg-options "-ftrivial-auto-var-init=zero" } */
_Complex long double result;
@@ -15,6 +15,7 @@ _Complex long double foo()
return result;
}
-/* { dg-final { scan-assembler-times "\\.long\t0" 14 } } */
+/* { dg-final { scan-assembler-times "\\.long\t0" 14 { target lp64 } } } */
+/* { dg-final { scan-assembler-times "\\.long\t0" 12 { target ia32 } } } */
@@ -1,6 +1,6 @@
/* Verify pattern initialization for complex type automatic variables. */
/* { dg-do compile } */
-/* { dg-options "-ftrivial-auto-var-init=pattern -fdump-rtl-expand" } */
+/* { dg-options "-ftrivial-auto-var-init=pattern -fdump-rtl-expand -march=x86-64 -mtune=generic -msse" } */
_Complex long double result;
@@ -1,6 +1,6 @@
/* Verify zero initialization for array, union, and structure type automatic variables. */
/* { dg-do compile } */
-/* { dg-options "-ftrivial-auto-var-init=zero -fdump-rtl-expand" } */
+/* { dg-options "-ftrivial-auto-var-init=zero -fdump-rtl-expand -march=x86-64 -mtune=generic -fno-stack-protector -msse" } */
struct S
{
@@ -1,6 +1,6 @@
/* Verify pattern initialization for array, union, and structure type automatic variables. */
/* { dg-do compile } */
-/* { dg-options "-ftrivial-auto-var-init=pattern -fdump-rtl-expand" } */
+/* { dg-options "-ftrivial-auto-var-init=pattern -fdump-rtl-expand -march=x86-64 -mtune=generic -msse" } */
struct S
{
@@ -1,7 +1,7 @@
/* Verify zero initialization for structure type automatic variables with
padding. */
/* { dg-do compile } */
-/* { dg-options "-ftrivial-auto-var-init=zero -fdump-rtl-expand" } */
+/* { dg-options "-ftrivial-auto-var-init=zero -fdump-rtl-expand -march=x86-64 -mtune=generic -msse" } */
struct test_aligned {
int internal1;
@@ -1,7 +1,7 @@
/* Verify pattern initialization for array type with structure element with
padding. */
/* { dg-do compile } */
-/* { dg-options "-ftrivial-auto-var-init=pattern -fdump-rtl-expand" } */
+/* { dg-options "-ftrivial-auto-var-init=pattern -fdump-rtl-expand -march=x86-64 -mtune=generic -msse" } */
struct test_trailing_hole {
int one;
@@ -1,7 +1,7 @@
/* Verify zero initialization for union type with structure field with
padding. */
/* { dg-do compile } */
-/* { dg-options "-ftrivial-auto-var-init=zero -fdump-rtl-expand" } */
+/* { dg-options "-ftrivial-auto-var-init=zero -fdump-rtl-expand -march=x86-64 -mtune=generic -msse" } */
struct test_trailing_hole {
int one;
@@ -1,7 +1,7 @@
/* Verify pattern initialization for union type with structure field with
padding. */
/* { dg-do compile } */
-/* { dg-options "-ftrivial-auto-var-init=pattern -fdump-rtl-expand" } */
+/* { dg-options "-ftrivial-auto-var-init=pattern -fdump-rtl-expand -march=x86-64 -mtune=generic -msse" } */
struct test_trailing_hole {
int one;
@@ -1,7 +1,7 @@
/* Verify pattern initialization for structure type automatic variables with
padding. */
/* { dg-do compile } */
-/* { dg-options "-ftrivial-auto-var-init=pattern -fdump-rtl-expand" } */
+/* { dg-options "-ftrivial-auto-var-init=pattern -fdump-rtl-expand -march=x86-64 -mtune=generic -msse" } */
struct test_aligned {
int internal1;
@@ -1,7 +1,7 @@
/* Verify zero initialization for nested structure type automatic variables with
padding. */
/* { dg-do compile } */
-/* { dg-options "-ftrivial-auto-var-init=zero" } */
+/* { dg-options "-ftrivial-auto-var-init=zero -march=x86-64" } */
struct test_aligned {
unsigned internal1;
@@ -24,7 +24,9 @@ int foo ()
}
/* { dg-final { scan-assembler "movl\t\\\$0," } } */
-/* { dg-final { scan-assembler "movl\t\\\$16," } } */
-/* { dg-final { scan-assembler "rep stosq" } } */
+/* { dg-final { scan-assembler "movl\t\\\$16," { target lp64 } } } */
+/* { dg-final { scan-assembler "rep stosq" { target lp64 } } } */
+/* { dg-final { scan-assembler "movl\t\\\$32," { target ia32 } } } */
+/* { dg-final { scan-assembler "rep stosl" { target ia32 } } } */
@@ -1,7 +1,7 @@
/* Verify pattern initialization for nested structure type automatic variables with
padding. */
/* { dg-do compile } */
-/* { dg-options "-ftrivial-auto-var-init=pattern -fdump-rtl-expand" } */
+/* { dg-options "-ftrivial-auto-var-init=pattern -fdump-rtl-expand -march=x86-64 -mtune=generic -msse" } */
struct test_aligned {
unsigned internal1;
@@ -1,7 +1,7 @@
/* Verify zero initialization for structure type automatic variables with
tail padding. */
/* { dg-do compile } */
-/* { dg-options "-ftrivial-auto-var-init=zero -fdump-rtl-expand" } */
+/* { dg-options "-ftrivial-auto-var-init=zero -fdump-rtl-expand -march=x86-64 -mtune=generic -msse" } */
struct test_trailing_hole {
char *one;
@@ -1,7 +1,7 @@
/* Verify pattern initialization for structure type automatic variables with
tail padding. */
/* { dg-do compile } */
-/* { dg-options "-ftrivial-auto-var-init=pattern -fdump-rtl-expand" } */
+/* { dg-options "-ftrivial-auto-var-init=pattern -fdump-rtl-expand -march=x86-64 -mtune=generic -msse" } */
struct test_trailing_hole {
char *one;
@@ -1,7 +1,7 @@
/* Verify zero initialization for structure type automatic variables with
padding and has explicit initialization. */
/* { dg-do compile } */
-/* { dg-options "-ftrivial-auto-var-init=zero" } */
+/* { dg-options "-ftrivial-auto-var-init=zero -fdump-rtl-expand -march=x86-64 -mtune=generic -msse -fno-stack-protector" } */
struct test_trailing_hole {
int one;
@@ -17,6 +17,7 @@ int foo ()
return var.four;
}
-/* { dg-final { scan-assembler-times "movq\t\\\$0," 2 } } */
+/* { dg-final { scan-rtl-dump-times "const_int 0 \\\[0\\\]\\\) repeated x16" 1 "expand" { target ia32 } } } */
+/* { dg-final { scan-rtl-dump-times "const_int 0 \\\[0\\\]\\\)" 1 "expand" { target lp64 } } } */
@@ -1,7 +1,7 @@
/* Verify pattern initialization for structure type automatic variables with
padding and has explicit initialization. */
/* { dg-do compile } */
-/* { dg-options "-ftrivial-auto-var-init=pattern" } */
+/* { dg-options "-ftrivial-auto-var-init=pattern -fdump-rtl-expand -march=x86-64 -mtune=generic -msse -fno-stack-protector" } */
struct test_trailing_hole {
int one;
@@ -17,6 +17,5 @@ int foo ()
return var.four;
}
-/* { dg-final { scan-assembler-times "movq\t\\\$0," 2 } } */
-
-
+/* { dg-final { scan-rtl-dump-times "const_int 0 \\\[0\\\]\\\) repeated x16" 1 "expand" { target ia32 } } } */
+/* { dg-final { scan-rtl-dump-times "const_int 0 \\\[0\\\]\\\)" 1 "expand" { target lp64 } } } */
@@ -1,7 +1,7 @@
/* Verify zero initialization for array type with structure element with
padding. */
/* { dg-do compile } */
-/* { dg-options "-ftrivial-auto-var-init=zero" } */
+/* { dg-options "-ftrivial-auto-var-init=zero -march=x86-64" } */
struct test_trailing_hole {
int one;
@@ -19,4 +19,7 @@ int foo ()
}
/* { dg-final { scan-assembler "movl\t\\\$0," } } */
-/* { dg-final { scan-assembler "rep stosq" } } */
+/* { dg-final { scan-assembler "movl\t\\\$20," { target lp64} } } */
+/* { dg-final { scan-assembler "rep stosq" { target lp64 } } } */
+/* { dg-final { scan-assembler "movl\t\\\$40," { target ia32} } } */
+/* { dg-final { scan-assembler "rep stosl" { target ia32 } } } */
Hi, This is the patch to fix gcc.target/i386/auto-init-* tests. I have tested the change at X86_64-linux with make check-gcc RUNTESTFLAGS='--target_board=unix\{-m64,-m64/-march=skylake-avx512,-m64/-fstack-protector-all,-m64/-fstack-clash-protection,-m32/-mno-sse,-m32/-mtune=bonnell,-m32/-march=bonnell,-m32/-fstack-protector-all/-fstack-clash-protection\} i386.exp=auto-init*’ make check-gcc RUNTESTFLAGS='--target_board=unix\{-m64,-m64/-march=skylake-avx512/-fPIC,-m64/-fstack-protector-all/-fPIC,-m64/-fstack-clash-protection/-fPIC,-m32/-mno-sse/-fPIC,-m32/-mtune=bonnell/-fPIC,-m32/-march=bonnell/-fPIC,-m32/-fstack-protector-all/-fstack-clash-protection/-fPIC\} i386.exp=auto-init*’ Everything works fine. Okay for commit? Thanks. Qing ************************** testsuite: Fix gcc.target/i386/auto-init-* tests. This set of tests failed on many different combination of -march, -mtune. some of them failed with -fstack-protestor-all, or -mno-sse. And the pattern matches are also different on lp64 or ia32. The reason for these failures is that the RTL or assembly level patten matches are only valid for -march=x86-64 -mtune=generic. We restrict the testing only for -march=x86-64 and -mtune=generic. Also add -fno-stack-protector or -msse for some of the testing cases. gcc/testsuite/ChangeLog: 2021-09-17 qing zhao <qing.zhao@oracle.com> * gcc.target/i386/auto-init-1.c: Restrict the testing only for -march=x86-64 and -mtune=generic. Add -fno-stack-protector. * gcc.target/i386/auto-init-2.c: Restrict the testing only for -march=x86-64 and -mtune=generic -msse. * gcc.target/i386/auto-init-3.c: Likewise. * gcc.target/i386/auto-init-4.c: Likewise. * gcc.target/i386/auto-init-5.c: Different pattern match for lp64 and ia32. * gcc.target/i386/auto-init-6.c: Restrict the testing only for -march=x86-64 and -mtune-generic -msse. Add -fno-stack-protector. * gcc.target/i386/auto-init-7.c: Likewise. * gcc.target/i386/auto-init-8.c: Restrict the testing only for -march=x86-64 and -mtune=generic -msse.. * gcc.target/i386/auto-init-padding-1.c: Likewise. * gcc.target/i386/auto-init-padding-10.c: Likewise. * gcc.target/i386/auto-init-padding-11.c: Likewise. * gcc.target/i386/auto-init-padding-12.c: Likewise. * gcc.target/i386/auto-init-padding-2.c: Likewise. * gcc.target/i386/auto-init-padding-3.c: Restrict the testing only for -march=x86-64. Different pattern match for lp64 and ia32. * gcc.target/i386/auto-init-padding-4.c: Restrict the testing only for -march=x86-64 and -mtune-generic -msse. * gcc.target/i386/auto-init-padding-5.c: Likewise. * gcc.target/i386/auto-init-padding-6.c: Likewise. * gcc.target/i386/auto-init-padding-7.c: Restrict the testing only for -march=x86-64 and -mtune-generic -msse. Add -fno-stack-protector. * gcc.target/i386/auto-init-padding-8.c: Likewise. * gcc.target/i386/auto-init-padding-9.c: Restrict the testing only for -march=x86-64. Different pattern match for lp64 and ia32. **************** From dd9902a95fb0631f5e2eecb37e76b559913484c7 Mon Sep 17 00:00:00 2001 From: Qing Zhao <qing.zhao@oracle.com> Date: Fri, 17 Sep 2021 14:49:25 +0000 Subject: [PATCH] Fix i386 testing cases --- gcc/testsuite/gcc.target/i386/auto-init-1.c | 2 +- gcc/testsuite/gcc.target/i386/auto-init-2.c | 8 +++++--- gcc/testsuite/gcc.target/i386/auto-init-3.c | 5 +++-- gcc/testsuite/gcc.target/i386/auto-init-4.c | 10 ++++++---- gcc/testsuite/gcc.target/i386/auto-init-5.c | 5 +++-- gcc/testsuite/gcc.target/i386/auto-init-6.c | 2 +- gcc/testsuite/gcc.target/i386/auto-init-7.c | 2 +- gcc/testsuite/gcc.target/i386/auto-init-8.c | 2 +- gcc/testsuite/gcc.target/i386/auto-init-padding-1.c | 2 +- gcc/testsuite/gcc.target/i386/auto-init-padding-10.c | 2 +- gcc/testsuite/gcc.target/i386/auto-init-padding-11.c | 2 +- gcc/testsuite/gcc.target/i386/auto-init-padding-12.c | 2 +- gcc/testsuite/gcc.target/i386/auto-init-padding-2.c | 2 +- gcc/testsuite/gcc.target/i386/auto-init-padding-3.c | 8 +++++--- gcc/testsuite/gcc.target/i386/auto-init-padding-4.c | 2 +- gcc/testsuite/gcc.target/i386/auto-init-padding-5.c | 2 +- gcc/testsuite/gcc.target/i386/auto-init-padding-6.c | 2 +- gcc/testsuite/gcc.target/i386/auto-init-padding-7.c | 5 +++-- gcc/testsuite/gcc.target/i386/auto-init-padding-8.c | 7 +++---- gcc/testsuite/gcc.target/i386/auto-init-padding-9.c | 7 +++++-- 20 files changed, 45 insertions(+), 34 deletions(-)