public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-6158] testsuite: XFAIL some Wstringop-overflow tests ...
@ 2021-12-31 13:07 Uros Bizjak
  0 siblings, 0 replies; only message in thread
From: Uros Bizjak @ 2021-12-31 13:07 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:d9da496a82c0ba33098d622efba34f4750c4ccb9

commit r12-6158-gd9da496a82c0ba33098d622efba34f4750c4ccb9
Author: Uros Bizjak <ubizjak@gmail.com>
Date:   Fri Dec 31 14:06:07 2021 +0100

    testsuite: XFAIL some Wstringop-overflow tests ...
    
    ... for targets that support vectorization of 2-byte char stores
    with unaligned address at plain O2.
    
    2021-12-31  Uroš Bizjak  <ubizjak@gmail.com>
    
    gcc/testsuite/ChangeLog:
    
            * lib/target-supports.exp (check_vect_slp_store_usage):
            Handle TEST_V2QI_2.
            (check_effective_target_vect_slp_v2qi_store_unalign): New procedure.
            * c-c++-common/Wstringop-overflow-2.c: XFAIL specific tests for
            vect_slp_v2qi_store_unalign targets.
            * g++.dg/warn/Wstringop-overflow-3.C: Ditto.
            * gcc.dg/Wstringop-overflow-28.c: Ditto.
            * gcc.dg/Wstringop-overflow-68.c: Ditto.
            * gcc.dg/Wstringop-overflow-75.c: Ditto.
            * gcc.dg/Wstringop-overflow-76.c: Ditto.

Diff:
---
 gcc/testsuite/c-c++-common/Wstringop-overflow-2.c | 50 +++++++++++------------
 gcc/testsuite/g++.dg/warn/Wstringop-overflow-3.C  | 44 ++++++++++----------
 gcc/testsuite/gcc.dg/Wstringop-overflow-28.c      |  8 ++--
 gcc/testsuite/gcc.dg/Wstringop-overflow-68.c      |  2 +-
 gcc/testsuite/gcc.dg/Wstringop-overflow-75.c      | 36 ++++++++--------
 gcc/testsuite/gcc.dg/Wstringop-overflow-76.c      | 20 ++++-----
 gcc/testsuite/lib/target-supports.exp             | 16 ++++++++
 7 files changed, 96 insertions(+), 80 deletions(-)

diff --git a/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c b/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c
index e5802613a9c..3f9171947c2 100644
--- a/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c
+++ b/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c
@@ -19,7 +19,7 @@ struct Ax ax_;
 void gax_ (void)
 {
   ax_.a[0] = 0;                 // { dg-warning "\\\[-Wstringop-overflow" }
-  ax_.a[1] = 1;                 // { dg-warning "\\\[-Wstringop-overflow" }
+  ax_.a[1] = 1;                 // { dg-warning "\\\[-Wstringop-overflow" "" { xfail { vect_slp_v2qi_store_unalign } } }
   ax_.a[2] = 2;                 // { dg-warning "\\\[-Wstringop-overflow" }
 }
 
@@ -30,7 +30,7 @@ struct Ax ax0 = { 0 };
 void gax0 (void)
 {
   ax0.a[0] = 0;                 // { dg-warning "\\\[-Wstringop-overflow" }
-  ax0.a[1] = 1;                 // { dg-warning "\\\[-Wstringop-overflow" }
+  ax0.a[1] = 1;                 // { dg-warning "\\\[-Wstringop-overflow" "" { xfail { vect_slp_v2qi_store_unalign } } }
   ax0.a[2] = 2;                 // { dg-warning "\\\[-Wstringop-overflow" }
 }
 
@@ -41,7 +41,7 @@ struct Ax ax0_ = { 0, { } };
 void gax0_ (void)
 {
   ax0_.a[0] = 0;                // { dg-warning "\\\[-Wstringop-overflow" }
-  ax0_.a[1] = 1;                // { dg-warning "\\\[-Wstringop-overflow" }
+  ax0_.a[1] = 1;                // { dg-warning "\\\[-Wstringop-overflow" "" { xfail { vect_slp_v2qi_store_unalign } } }
   ax0_.a[2] = 2;                // { dg-warning "\\\[-Wstringop-overflow" }
 }
 
@@ -51,8 +51,8 @@ struct Ax ax1 = { 1, { 0 } };
 
 void gax1 (void)
 {
-  ax1.a[0] = 0;
-  ax1.a[1] = 1;                 // { dg-warning "\\\[-Wstringop-overflow" }
+  ax1.a[0] = 0;                 // { dg-warning "\\\[-Wstringop-overflow" "" { target { vect_slp_v2qi_store_unalign } } }
+  ax1.a[1] = 1;                 // { dg-warning "\\\[-Wstringop-overflow" "" { xfail { vect_slp_v2qi_store_unalign } } }
   ax1.a[2] = 2;                 // { dg-warning "\\\[-Wstringop-overflow" }
 }
 
@@ -100,7 +100,7 @@ struct A0 a0_;
 void ga0_ (void)
 {
   a0_.a[0] = 0;                 // { dg-warning "\\\[-Wstringop-overflow" }
-  a0_.a[1] = 1;                 // { dg-warning "\\\[-Wstringop-overflow" }
+  a0_.a[1] = 1;                 // { dg-warning "\\\[-Wstringop-overflow" "" { xfail { vect_slp_v2qi_store_unalign } } }
   a0_.a[2] = 2;                 // { dg-warning "\\\[-Wstringop-overflow" }
 }
 
@@ -111,7 +111,7 @@ struct A0 a00 = { 0 };
 void ga00 (void)
 {
   a00.a[0] = 0;                 // { dg-warning "\\\[-Wstringop-overflow" }
-  a00.a[1] = 1;                 // { dg-warning "\\\[-Wstringop-overflow" }
+  a00.a[1] = 1;                 // { dg-warning "\\\[-Wstringop-overflow" "" { xfail { vect_slp_v2qi_store_unalign } } }
   a00.a[2] = 2;                 // { dg-warning "\\\[-Wstringop-overflow" }
 }
 
@@ -122,7 +122,7 @@ struct A0 a00_ = { 0, { } };
 void ga00_ (void)
 {
   a00_.a[0] = 0;                // { dg-warning "\\\[-Wstringop-overflow" }
-  a00_.a[1] = 1;                // { dg-warning "\\\[-Wstringop-overflow" }
+  a00_.a[1] = 1;                // { dg-warning "\\\[-Wstringop-overflow" "" { xfail { vect_slp_v2qi_store_unalign } } }
   a00_.a[2] = 2;                // { dg-warning "\\\[-Wstringop-overflow" }
 }
 
@@ -166,13 +166,13 @@ struct A1 a1_;
 
 void ga1_ (void)
 {
-  a1_.a[0] = 0;
-  a1_.a[1] = 1;                 // { dg-warning "\\\[-Wstringop-overflow" }
+  a1_.a[0] = 0;                 // { dg-warning "\\\[-Wstringop-overflow" "" { target { vect_slp_v2qi_store_unalign } } }
+  a1_.a[1] = 1;                 // { dg-warning "\\\[-Wstringop-overflow" "" { xfail { vect_slp_v2qi_store_unalign } } }
   a1_.a[2] = 2;                 // { dg-warning "\\\[-Wstringop-overflow" }
 
   struct A1 a;
-  a.a[0] = 0;
-  a.a[1] = 1;                   // { dg-warning "\\\[-Wstringop-overflow" }
+  a.a[0] = 0;                   // { dg-warning "\\\[-Wstringop-overflow" "" { target { vect_slp_v2qi_store_unalign } } }
+  a.a[1] = 1;                   // { dg-warning "\\\[-Wstringop-overflow" "" { xfail { vect_slp_v2qi_store_unalign } } }
   a.a[2] = 2;                   // { dg-warning "\\\[-Wstringop-overflow" }
   sink (&a);
 }
@@ -183,8 +183,8 @@ struct A1 a1__ = { 0 };
 
 void ga1__ (void)
 {
-  a1__.a[0] = 0;
-  a1__.a[1] = 1;                 // { dg-warning "\\\[-Wstringop-overflow" }
+  a1__.a[0] = 0;                 // { dg-warning "\\\[-Wstringop-overflow" "" { target { vect_slp_v2qi_store_unalign } } }
+  a1__.a[1] = 1;                 // { dg-warning "\\\[-Wstringop-overflow" "" { xfail { vect_slp_v2qi_store_unalign } } }
   a1__.a[2] = 2;                 // { dg-warning "\\\[-Wstringop-overflow" }
 
   struct A1 a = { 1 };
@@ -200,8 +200,8 @@ struct A1 a1_0 = { 0, { } };
 
 void ga1_0_ (void)
 {
-  a1_0.a[0] = 0;
-  a1_0.a[1] = 1;                // { dg-warning "\\\[-Wstringop-overflow" }
+  a1_0.a[0] = 0;                // { dg-warning "\\\[-Wstringop-overflow" "" { target { vect_slp_v2qi_store_unalign } } }
+  a1_0.a[1] = 1;                // { dg-warning "\\\[-Wstringop-overflow" "" { xfail { vect_slp_v2qi_store_unalign } } }
   a1_0.a[2] = 2;                // { dg-warning "\\\[-Wstringop-overflow" }
 
   struct A1 a = { 1, { } };
@@ -217,8 +217,8 @@ struct A1 a1_1 = { 0, { 1 } };
 
 void ga1_1 (void)
 {
-  a1_1.a[0] = 0;
-  a1_1.a[1] = 1;                // { dg-warning "\\\[-Wstringop-overflow" }
+  a1_1.a[0] = 0;                // { dg-warning "\\\[-Wstringop-overflow" "" { target { vect_slp_v2qi_store_unalign } } }
+  a1_1.a[1] = 1;                // { dg-warning "\\\[-Wstringop-overflow" "" { xfail { vect_slp_v2qi_store_unalign } } }
   a1_1.a[2] = 2;                // { dg-warning "\\\[-Wstringop-overflow" }
 
   struct A1 a = { 0, { 1 } };   // { dg-warning "\\\[-Wstringop-overflow" "pr102706" { target { vect_slp_v4qi_store_align } } }
@@ -266,12 +266,12 @@ struct A1i a1i_;
 void ga1i_ (void)
 {
   a1i_.a[0] = 0;
-  a1i_.a[1] = 1;                // { dg-warning "\\\[-Wstringop-overflow" }
+  a1i_.a[1] = 1;                // { dg-warning "\\\[-Wstringop-overflow" "" { xfail { vect_slp_v2qi_store_unalign } } }
   a1i_.a[2] = 2;                // { dg-warning "\\\[-Wstringop-overflow" }
 
   struct A1i a;
   a.a[0] = 1;
-  a.a[1] = 2;                   // { dg-warning "\\\[-Wstringop-overflow" }
+  a.a[1] = 2;                   // { dg-warning "\\\[-Wstringop-overflow" "" { xfail { vect_slp_v2qi_store_unalign } } }
   a.a[2] = 3;                   // { dg-warning "\\\[-Wstringop-overflow" }
   sink (&a);
 }
@@ -283,7 +283,7 @@ struct A1i a1i__ = { 0 };
 void ga1i__ (void)
 {
   a1i__.a[0] = 0;
-  a1i__.a[1] = 1;                // { dg-warning "\\\[-Wstringop-overflow" }
+  a1i__.a[1] = 1;                // { dg-warning "\\\[-Wstringop-overflow" "" { xfail { vect_slp_v2qi_store_unalign } } }
   a1i__.a[2] = 2;                // { dg-warning "\\\[-Wstringop-overflow" }
 
   struct A1i a = { 0 };
@@ -299,8 +299,8 @@ struct A1 a1i_0 = { 0, { } };
 
 void ga1i_0_ (void)
 {
-  a1i_0.a[0] = 0;
-  a1i_0.a[1] = 1;               // { dg-warning "\\\[-Wstringop-overflow" }
+  a1i_0.a[0] = 0;               // { dg-warning "\\\[-Wstringop-overflow" "" { target { vect_slp_v2qi_store_unalign } } }
+  a1i_0.a[1] = 1;               // { dg-warning "\\\[-Wstringop-overflow" "" { xfail { vect_slp_v2qi_store_unalign } } }
   a1i_0.a[2] = 2;               // { dg-warning "\\\[-Wstringop-overflow" }
 
   struct A1 a = { 0, { } };
@@ -316,8 +316,8 @@ struct A1 a1i_1 = { 0, { 1 } };
 
 void ga1i_1 (void)
 {
-  a1i_1.a[0] = 0;
-  a1i_1.a[1] = 1;               // { dg-warning "\\\[-Wstringop-overflow" }
+  a1i_1.a[0] = 0;               // { dg-warning "\\\[-Wstringop-overflow" "" { target { vect_slp_v2qi_store_unalign } } }
+  a1i_1.a[1] = 1;               // { dg-warning "\\\[-Wstringop-overflow" "" { xfail { vect_slp_v2qi_store_unalign } } }
   a1i_1.a[2] = 2;               // { dg-warning "\\\[-Wstringop-overflow" }
 
   struct A1 a = { 0, { 1 } };   // { dg-warning "\\\[-Wstringop-overflow" "pr102462" { target { vect_slp_v4qi_store_align } } }
diff --git a/gcc/testsuite/g++.dg/warn/Wstringop-overflow-3.C b/gcc/testsuite/g++.dg/warn/Wstringop-overflow-3.C
index c68e82a4a58..e1d547fe4d4 100644
--- a/gcc/testsuite/g++.dg/warn/Wstringop-overflow-3.C
+++ b/gcc/testsuite/g++.dg/warn/Wstringop-overflow-3.C
@@ -21,7 +21,7 @@ Ax ax_;
 NOIPA void gax_ ()
 {
   ax_.a[0] = 0;                 // { dg-warning "\\\[-Wstringop-overflow" }
-  ax_.a[1] = 0;                 // { dg-warning "\\\[-Wstringop-overflow" }
+  ax_.a[1] = 0;                 // { dg-warning "\\\[-Wstringop-overflow" "" { xfail { vect_slp_v2qi_store_unalign } } }
   ax_.a[2] = 0;                 // { dg-warning "\\\[-Wstringop-overflow" }
 }
 
@@ -32,7 +32,7 @@ Ax ax0 = { 0 };
 NOIPA void gax0 ()
 {
   ax0.a[0] = 0;                 // { dg-warning "\\\[-Wstringop-overflow" }
-  ax0.a[1] = 0;                 // { dg-warning "\\\[-Wstringop-overflow" }
+  ax0.a[1] = 0;                 // { dg-warning "\\\[-Wstringop-overflow" "" { xfail { vect_slp_v2qi_store_unalign } } }
   ax0.a[2] = 0;                 // { dg-warning "\\\[-Wstringop-overflow" }
 }
 
@@ -43,7 +43,7 @@ Ax ax0_ = { 0, { } };
 NOIPA void gax0_ ()
 {
   ax0_.a[0] = 0;                // { dg-warning "\\\[-Wstringop-overflow" }
-  ax0_.a[1] = 0;                // { dg-warning "\\\[-Wstringop-overflow" }
+  ax0_.a[1] = 0;                // { dg-warning "\\\[-Wstringop-overflow" "" { xfail { vect_slp_v2qi_store_unalign } } }
   ax0_.a[2] = 0;                // { dg-warning "\\\[-Wstringop-overflow" }
 }
 
@@ -53,8 +53,8 @@ Ax ax1 = { 1, { 0 } };
 
 NOIPA void gax1 ()
 {
-  ax1.a[0] = 0;
-  ax1.a[1] = 0;                 // { dg-warning "\\\[-Wstringop-overflow" }
+  ax1.a[0] = 0;                 // { dg-warning "\\\[-Wstringop-overflow" "" { target { vect_slp_v2qi_store_unalign } } }
+  ax1.a[1] = 0;                 // { dg-warning "\\\[-Wstringop-overflow" "" { xfail { vect_slp_v2qi_store_unalign } } }
   ax1.a[2] = 0;                 // { dg-warning "\\\[-Wstringop-overflow" }
 }
 
@@ -102,7 +102,7 @@ A0 a0_;
 NOIPA void ga0_ ()
 {
   a0_.a[0] = 0;                 // { dg-warning "\\\[-Wstringop-overflow" }
-  a0_.a[1] = 0;                 // { dg-warning "\\\[-Wstringop-overflow" }
+  a0_.a[1] = 0;                 // { dg-warning "\\\[-Wstringop-overflow" "" { xfail { vect_slp_v2qi_store_unalign } } }
   a0_.a[2] = 0;                 // { dg-warning "\\\[-Wstringop-overflow" }
 }
 
@@ -113,7 +113,7 @@ A0 a00 = { 0 };
 NOIPA void ga00 ()
 {
   a00.a[0] = 0;                 // { dg-warning "\\\[-Wstringop-overflow" }
-  a00.a[1] = 0;                 // { dg-warning "\\\[-Wstringop-overflow" }
+  a00.a[1] = 0;                 // { dg-warning "\\\[-Wstringop-overflow" "" { xfail { vect_slp_v2qi_store_unalign } } }
   a00.a[2] = 0;                 // { dg-warning "\\\[-Wstringop-overflow" }
 }
 
@@ -124,7 +124,7 @@ A0 a00_ = { 0, { } };
 NOIPA void ga00_ ()
 {
   a00_.a[0] = 0;                // { dg-warning "\\\[-Wstringop-overflow" }
-  a00_.a[1] = 0;                // { dg-warning "\\\[-Wstringop-overflow" }
+  a00_.a[1] = 0;                // { dg-warning "\\\[-Wstringop-overflow" "" { xfail { vect_slp_v2qi_store_unalign } } }
   a00_.a[2] = 0;                // { dg-warning "\\\[-Wstringop-overflow" }
 }
 
@@ -168,8 +168,8 @@ A1 a1_;
 
 NOIPA void ga1_ ()
 {
-  a1_.a[0] = 0;
-  a1_.a[1] = 0;                 // { dg-warning "\\\[-Wstringop-overflow" }
+  a1_.a[0] = 0;                 // { dg-warning "\\\[-Wstringop-overflow" "" { target { vect_slp_v2qi_store_unalign } } }
+  a1_.a[1] = 0;                 // { dg-warning "\\\[-Wstringop-overflow" "" { xfail { vect_slp_v2qi_store_unalign } } }
   a1_.a[2] = 0;                 // { dg-warning "\\\[-Wstringop-overflow" }
 }
 
@@ -179,8 +179,8 @@ A1 a1__ = { 0 };
 
 NOIPA void ga1__ ()
 {
-  a1__.a[0] = 0;
-  a1__.a[1] = 0;                 // { dg-warning "\\\[-Wstringop-overflow" }
+  a1__.a[0] = 0;                 // { dg-warning "\\\[-Wstringop-overflow" "" { target { vect_slp_v2qi_store_unalign } } }
+  a1__.a[1] = 0;                 // { dg-warning "\\\[-Wstringop-overflow" "" { xfail { vect_slp_v2qi_store_unalign } } }
   a1__.a[2] = 0;                 // { dg-warning "\\\[-Wstringop-overflow" }
 }
 
@@ -190,8 +190,8 @@ A1 a1_0 = { 0, { } };
 
 NOIPA void ga1_0_ ()
 {
-  a1_0.a[0] = 0;
-  a1_0.a[1] = 0;                // { dg-warning "\\\[-Wstringop-overflow" }
+  a1_0.a[0] = 0;                // { dg-warning "\\\[-Wstringop-overflow" "" { target { vect_slp_v2qi_store_unalign } } }
+  a1_0.a[1] = 0;                // { dg-warning "\\\[-Wstringop-overflow" "" { xfail { vect_slp_v2qi_store_unalign } } }
   a1_0.a[2] = 0;                // { dg-warning "\\\[-Wstringop-overflow" }
 }
 
@@ -201,8 +201,8 @@ A1 a1_1 = { 0, { 1 } };
 
 NOIPA void ga1_1 ()
 {
-  a1_1.a[0] = 0;
-  a1_1.a[1] = 0;                // { dg-warning "\\\[-Wstringop-overflow" }
+  a1_1.a[0] = 0;                // { dg-warning "\\\[-Wstringop-overflow" "" { target { vect_slp_v2qi_store_unalign } } }
+  a1_1.a[1] = 0;                // { dg-warning "\\\[-Wstringop-overflow" "" { xfail { vect_slp_v2qi_store_unalign } } }
   a1_1.a[2] = 0;                // { dg-warning "\\\[-Wstringop-overflow" }
 }
 
@@ -244,7 +244,7 @@ A1i a1i_;
 NOIPA void ga1i_ ()
 {
   a1i_.a[0] = 0;
-  a1i_.a[1] = 0;                // { dg-warning "\\\[-Wstringop-overflow" }
+  a1i_.a[1] = 0;                // { dg-warning "\\\[-Wstringop-overflow" "" { xfail { vect_slp_v2qi_store_unalign } } }
   a1i_.a[2] = 0;                // { dg-warning "\\\[-Wstringop-overflow" }
 }
 
@@ -255,7 +255,7 @@ A1i a1i__ = { 0 };
 NOIPA void ga1i__ ()
 {
   a1i__.a[0] = 0;
-  a1i__.a[1] = 0;                // { dg-warning "\\\[-Wstringop-overflow" }
+  a1i__.a[1] = 0;                // { dg-warning "\\\[-Wstringop-overflow" "" { xfail { vect_slp_v2qi_store_unalign } } }
   a1i__.a[2] = 0;                // { dg-warning "\\\[-Wstringop-overflow" }
 }
 
@@ -265,8 +265,8 @@ A1 a1i_0 = { 0, { } };
 
 NOIPA void ga1i_0_ ()
 {
-  a1i_0.a[0] = 0;
-  a1i_0.a[1] = 0;               // { dg-warning "\\\[-Wstringop-overflow" }
+  a1i_0.a[0] = 0;               // { dg-warning "\\\[-Wstringop-overflow" "" { target { vect_slp_v2qi_store_unalign } } }
+  a1i_0.a[1] = 0;               // { dg-warning "\\\[-Wstringop-overflow" "" { xfail { vect_slp_v2qi_store_unalign } } }
   a1i_0.a[2] = 0;               // { dg-warning "\\\[-Wstringop-overflow" }
 }
 
@@ -276,8 +276,8 @@ A1 a1i_1 = { 0, { 1 } };
 
 NOIPA void ga1i_1 ()
 {
-  a1i_1.a[0] = 0;
-  a1i_1.a[1] = 0;               // { dg-warning "\\\[-Wstringop-overflow" }
+  a1i_1.a[0] = 0;               // { dg-warning "\\\[-Wstringop-overflow" "" { target { vect_slp_v2qi_store_unalign } } }
+  a1i_1.a[1] = 0;               // { dg-warning "\\\[-Wstringop-overflow" "" { xfail { vect_slp_v2qi_store_unalign } } }
   a1i_1.a[2] = 0;               // { dg-warning "\\\[-Wstringop-overflow" }
 }
 
diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-28.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-28.c
index 5009fb5763a..f3e31fbade3 100644
--- a/gcc/testsuite/gcc.dg/Wstringop-overflow-28.c
+++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-28.c
@@ -152,8 +152,8 @@ void ptr_add_2 (int n, int i0, int i1)
   q += i0;
   q[0] = 0;   // p[0]
   q += i1;
-  q[0] = 1;   // p[1]
-  q[1] = 2;   // p[2]     // { dg-warning "\\\[-Wstringop-overflow" }
+  q[0] = 1;   // p[1]     // { dg-warning "\\\[-Wstringop-overflow" "" { target { vect_slp_v2qi_store_unalign } } }
+  q[1] = 2;   // p[2]     // { dg-warning "\\\[-Wstringop-overflow" "" { xfail { vect_slp_v2qi_store_unalign } } }
 
   sink (p, q);
 }
@@ -175,8 +175,8 @@ void ptr_add_3 (int n, int i0, int i1, int i2)
   q[0] = 1;   // p[1]
   q[1] = 2;   // p[2]
   q += i2;
-  q[0] = 3;   // p[3]
-  q[1] = 4;   // p[4]     // { dg-warning "\\\[-Wstringop-overflow" }
+  q[0] = 3;   // p[3]     // { dg-warning "\\\[-Wstringop-overflow" "" { target { vect_slp_v2qi_store_unalign } } }
+  q[1] = 4;   // p[4]     // { dg-warning "\\\[-Wstringop-overflow" "" { xfail { vect_slp_v2qi_store_unalign } } }
 
   sink (p, q);
 }
diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-68.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-68.c
index 05ea56fca67..e69178f4538 100644
--- a/gcc/testsuite/gcc.dg/Wstringop-overflow-68.c
+++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-68.c
@@ -57,7 +57,7 @@ void warn_comp_lit_zero (void)
 
 void warn_comp_lit (void)
 {
-  *(AC2*)a1 = Ac2;      // { dg-warning "writing 2 bytes into a region of size 1" "pr101475" { xfail *-*-* } }
+  *(AC2*)a1 = Ac2;      // { dg-warning "writing 2 bytes into a region of size 1" "pr101475" { target { vect_slp_v2qi_store_unalign } } }
   // After vectorization, below codes are optimized to
   // MEM <vector(4) char> [(char *)&a2] = { 0, 1, 2, 3 };
   // MEM <vector(4) char> [(char *)&a3] = { 0, 1, 2, 3 };
diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-75.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-75.c
index 0b242e8562d..9f9c3a9c2a7 100644
--- a/gcc/testsuite/gcc.dg/Wstringop-overflow-75.c
+++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-75.c
@@ -9,7 +9,7 @@
    the offset into it (although the offset might be better included in
    the warning).  */
 extern char a3[3];
-extern char a5[5];  // { dg-message "at offset 5 into destination object 'a5' of size 5" "note" }
+extern char a5[5];  // { dg-message "at offset \[^a-zA-Z\n\r\]*5\[^a-zA-Z0-9\]* into destination object 'a5' of size 5" "note" }
 
 void min_a3_a5 (int i)
 {
@@ -20,14 +20,14 @@ void min_a3_a5 (int i)
      by its own warning independently of -Wstringop-overflow.  */
   char *d = p < q ? p : q;
 
-  d[4] = 0;
-  d[5] = 0;         // { dg-warning "writing 1 byte into a region of size 0" }
+  d[4] = 0;         // { dg-warning "writing 2 bytes into a region of size 1" "" { target { vect_slp_v2qi_store_unalign } } }
+  d[5] = 0;         // { dg-warning "writing 1 byte into a region of size 0" "" { xfail { vect_slp_v2qi_store_unalign } } }
 }
 
 
 // Same as above but with the larger array as the first MIN_EXPR operand.
 extern char b4[4];
-extern char b6[6];  // { dg-message "at offset 6 into destination object 'b6' of size 6" "note" }
+extern char b6[6];  // { dg-message "at offset \[^a-zA-Z\n\r\]*6\[^a-zA-Z0-9\]* into destination object 'b6' of size 6" "note" }
 
 void min_b6_b4 (int i)
 {
@@ -35,36 +35,36 @@ void min_b6_b4 (int i)
   char *q = b4 + i;
   char *d = p < q ? p : q;
 
-  d[5] = 0;
-  d[6] = 0;         // { dg-warning "writing 1 byte into a region of size 0" }
+  d[5] = 0;         // { dg-warning "writing 2 bytes into a region of size 1" "" { target { vect_slp_v2qi_store_unalign } } }
+  d[6] = 0;         // { dg-warning "writing 1 byte into a region of size 0" "" { xfail { vect_slp_v2qi_store_unalign } } }
 }
 
 
 /* Same as above but with the first MIN_EXPR operand pointing to an unknown
    object.  */
-extern char c7[7];  // { dg-message "at offset 7 into destination object 'c7' of size 7" "note" }
+extern char c7[7];  // { dg-message "at offset 7 into destination object 'c7' of size 7" "note" { xfail { vect_slp_v2qi_store_unalign } } }
 
 void min_p_c7 (char *p, int i)
 {
   char *q = c7 + i;
   char *d = p < q ? p : q;
 
-  d[6] = 0;
-  d[7] = 0;         // { dg-warning "writing 1 byte into a region of size 0" }
+  d[6] = 0;         // { dg-warning "writing 2 bytes into a region of size 1" "" { target { vect_slp_v2qi_store_unalign } } }
+  d[7] = 0;         // { dg-warning "writing 1 byte into a region of size 0" "" { xfail { vect_slp_v2qi_store_unalign } } }
 }
 
 
 /* Same as above but with the second MIN_EXPR operand pointing to an unknown
    object.  */
-extern char d8[8];  // { dg-message "at offset 8 into destination object 'd8' of size 8" "note" }
+extern char d8[8];  // { dg-message "at offset 8 into destination object 'd8' of size 8" "note" { xfail { vect_slp_v2qi_store_unalign } } }
 
 void min_d8_p (char *q, int i)
 {
   char *p = d8 + i;
   char *d = p < q ? p : q;
 
-  d[7] = 0;
-  d[8] = 0;         // { dg-warning "writing 1 byte into a region of size 0" }
+  d[7] = 0;         // { dg-warning "writing 2 bytes into a region of size 1" "" { target { vect_slp_v2qi_store_unalign } } }
+  d[8] = 0;         // { dg-warning "writing 1 byte into a region of size 0" "" { xfail { vect_slp_v2qi_store_unalign } } }
 }
 
 
@@ -89,7 +89,7 @@ void min_A3_A5 (int i, struct A3_5 *pa3_5)
 struct B4_B6
 {
   char b4[4];
-  char b6[6];       // { dg-message "at offset 6 into destination object 'b6' of size 6" "note" }
+  char b6[6];       // { dg-message "at offset 6 into destination object 'b6' of size 6" "note" { xfail { vect_slp_v2qi_store_unalign } } }
 };
 
 void min_B6_B4 (int i, struct B4_B6 *pb4_b6)
@@ -99,13 +99,13 @@ void min_B6_B4 (int i, struct B4_B6 *pb4_b6)
   char *d = p < q ? p : q;
 
   d[5] = 0;
-  d[6] = 0;         // { dg-warning "writing 1 byte into a region of size 0" }
+  d[6] = 0;         // { dg-warning "writing 1 byte into a region of size 0" "" { xfail { vect_slp_v2qi_store_unalign } } }
 }
 
 
 struct C7
 {
-  char c7[7];       // { dg-message "at offset 7 into destination object 'c7' of size 7" "note" }
+  char c7[7];       // { dg-message "at offset 7 into destination object 'c7' of size 7" "note" { xfail { vect_slp_v2qi_store_unalign } } }
 };
 
 void min_p_C7 (char *p, int i, struct C7 *pc7)
@@ -114,13 +114,13 @@ void min_p_C7 (char *p, int i, struct C7 *pc7)
   char *d = p < q ? p : q;
 
   d[6] = 0;
-  d[7] = 0;         // { dg-warning "writing 1 byte into a region of size 0" }
+  d[7] = 0;         // { dg-warning "writing 1 byte into a region of size 0" "" { xfail { vect_slp_v2qi_store_unalign } } }
 }
 
 
 struct D8
 {
-  char d8[8];       // { dg-message "at offset 8 into destination object 'd8' of size 8" "note" }
+  char d8[8];       // { dg-message "at offset 8 into destination object 'd8' of size 8" "note" { xfail { vect_slp_v2qi_store_unalign } } }
 };
 
 void min_D8_p (char *q, int i, struct D8 *pd8)
@@ -129,5 +129,5 @@ void min_D8_p (char *q, int i, struct D8 *pd8)
   char *d = p < q ? p : q;
 
   d[7] = 0;
-  d[8] = 0;         // { dg-warning "writing 1 byte into a region of size 0" }
+  d[8] = 0;         // { dg-warning "writing 1 byte into a region of size 0" "" { xfail { vect_slp_v2qi_store_unalign } } }
 }
diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-76.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-76.c
index ee315a0c002..d5cf8662c43 100644
--- a/gcc/testsuite/gcc.dg/Wstringop-overflow-76.c
+++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-76.c
@@ -53,29 +53,29 @@ void max_b6_b4 (int i)
 
 /* Same as above but with the first MAX_EXPR operand pointing to an unknown
    object.  */
-extern char c7[7];  // { dg-message "at offset 7 into destination object 'c7' of size 7" "note" }
+extern char c7[7];  // { dg-message "at offset 7 into destination object 'c7' of size 7" "note"  { xfail { vect_slp_v2qi_store_unalign } } }
 
 void max_p_c7 (char *p, int i)
 {
   char *q = c7 + i;
   char *d = MAX (p, q);
 
-  d[6] = 0;
-  d[7] = 0;         // { dg-warning "writing 1 byte into a region of size 0" }
+  d[6] = 0;         // { dg-warning "writing 2 bytes into a region of size 1" "" { target { vect_slp_v2qi_store_unalign } } }
+  d[7] = 0;         // { dg-warning "writing 1 byte into a region of size 0" "" { xfail { vect_slp_v2qi_store_unalign } } }
 }
 
 
 /* Same as above but with the second MIN_EXPR operand pointing to an unknown
    object.  */
-extern char d8[8];  // { dg-message "at offset 8 into destination object 'd8' of size 8" "note" }
+extern char d8[8];  // { dg-message "at offset 8 into destination object 'd8' of size 8" "note"  { xfail { vect_slp_v2qi_store_unalign } } }
 
 void max_d8_p (char *q, int i)
 {
   char *p = d8 + i;
   char *d = MAX (p, q);
 
-  d[7] = 0;
-  d[8] = 0;         // { dg-warning "writing 1 byte into a region of size 0" }
+  d[7] = 0;         // { dg-warning "writing 2 bytes into a region of size 1" "" { target { vect_slp_v2qi_store_unalign } } }
+  d[8] = 0;         // { dg-warning "writing 1 byte into a region of size 0" "" { xfail { vect_slp_v2qi_store_unalign } } }
 }
 
 
@@ -122,7 +122,7 @@ void max_B6_B4 (int i, struct B4_B6 *pb4_b6)
 
 struct C7
 {
-  char c7[7];       // { dg-message "at offset 7 into destination object 'c7' of size 7" "note" }
+  char c7[7];       // { dg-message "at offset 7 into destination object 'c7' of size 7" "note"  { xfail { vect_slp_v2qi_store_unalign } } }
 };
 
 void max_p_C7 (char *p, int i, struct C7 *pc7)
@@ -131,13 +131,13 @@ void max_p_C7 (char *p, int i, struct C7 *pc7)
   char *d = MAX (p, q);
 
   d[6] = 0;
-  d[7] = 0;         // { dg-warning "writing 1 byte into a region of size 0" }
+  d[7] = 0;         // { dg-warning "writing 1 byte into a region of size 0" "" { xfail { vect_slp_v2qi_store_unalign } } }
 }
 
 
 struct D8
 {
-  char d8[8];       // { dg-message "at offset 8 into destination object 'd8' of size 8" "note" }
+  char d8[8];       // { dg-message "at offset 8 into destination object 'd8' of size 8" "note"  { xfail { vect_slp_v2qi_store_unalign } } }
 };
 
 void max_D8_p (char *q, int i, struct D8 *pd8)
@@ -146,5 +146,5 @@ void max_D8_p (char *q, int i, struct D8 *pd8)
   char *d = MAX (p, q);
 
   d[7] = 0;
-  d[8] = 0;         // { dg-warning "writing 1 byte into a region of size 0" }
+  d[8] = 0;         // { dg-warning "writing 1 byte into a region of size 0" "" { xfail { vect_slp_v2qi_store_unalign } } }
 }
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index 039125c866a..47bf413c262 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -7665,6 +7665,14 @@ proc check_vect_slp_store_usage { pattern macro } {
 	    a.a[1] = 4;
 	    sink (&a);
 	}
+	#elif TEST_V2QI_2
+	extern char p[2];
+	void
+	foo3_2 ()
+	{
+	    p[0] = 0;
+	    p[1] = 1;
+	}
 	#elif TEST_V4HI
 	struct Ax
 	{
@@ -7763,7 +7771,15 @@ proc check_effective_target_vect_slp_v2qi_store_align { } {
     set macro "TEST_V2QI"
     return [check_cached_effective_target vect_slp_v2qi_store_align {
 	expr [check_vect_slp_store_usage $pattern $macro] }]
+}
 
+# Return the true if target support vectorization of 2-byte char stores
+# with unaligned address at plain O2.
+proc check_effective_target_vect_slp_v2qi_store_unalign { } {
+    set pattern {add new stmt: MEM <vector\(2\) char>}
+    set macro "TEST_V2QI_2"
+    return [check_cached_effective_target vect_slp_v2qi_store_unalign {
+	expr [check_vect_slp_store_usage $pattern $macro ] }]
 }
 
 # Return the true if target support vectorization of 4-byte char stores


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-12-31 13:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-31 13:07 [gcc r12-6158] testsuite: XFAIL some Wstringop-overflow tests Uros Bizjak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).