Adjust testcase for O2 vectorization[Wuninitialized]

Message ID 20211013020912.34817-1-hongtao.liu@intel.com
State Committed
Headers
Series Adjust testcase for O2 vectorization[Wuninitialized] |

Commit Message

Liu, Hongtao Oct. 13, 2021, 2:09 a.m. UTC
  As discussed in PR.
It looks like it's just the the location of the warning that's off,
the warning itself is still issued but it's swallowed by the
dg-prune-output directive.

Since the test was added to verify the fix for an ICE without
vectorization I think disabling vectorization should be fine.
Ideally, we would understand why the location is wrong so let's keep
this bug open and add a comment to the test referencing this bug.

Pushed to trunk.

gcc/testsuite/ChangeLog:

	* g++.dg/warn/Wuninitialized-13.C: Add -fno-tree-vectorize.
---
 gcc/testsuite/g++.dg/warn/Wuninitialized-13.C | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
  

Patch

diff --git a/gcc/testsuite/g++.dg/warn/Wuninitialized-13.C b/gcc/testsuite/g++.dg/warn/Wuninitialized-13.C
index 210e74c3c3b..e92978f809a 100644
--- a/gcc/testsuite/g++.dg/warn/Wuninitialized-13.C
+++ b/gcc/testsuite/g++.dg/warn/Wuninitialized-13.C
@@ -1,11 +1,14 @@ 
 /* PR c/98597 - ICE in -Wuninitialized printing a MEM_REF
    { dg-do compile }
-   { dg-options "-O2 -Wall" } */
+   { dg-options "-O2 -Wall -fno-tree-vectorize" } */
 
+/* After vectorization, the location of the warning that's off,
+   the warning itself is still issued but it's swallowed by
+   the dg-prune-output directive. Refer to pr102700.  */
 struct shared_count {
   shared_count () { }
   shared_count (shared_count &r)
-    : pi (r.pi) { }     // { dg-warning "\\\[-Wuninitialized" "" { xfail { i?86-*-* x86_64-*-* } } }
+    : pi (r.pi) { }     // { dg-warning "\\\[-Wuninitialized"}
   int pi;
 };