Adjust testcase for O2 vectorization[Wuninitialized]
authorliuhongt <hongtao.liu@intel.com>
Wed, 13 Oct 2021 02:05:58 +0000 (10:05 +0800)
committerliuhongt <hongtao.liu@intel.com>
Thu, 14 Oct 2021 01:33:47 +0000 (09:33 +0800)
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.

gcc/testsuite/ChangeLog:

* g++.dg/warn/Wuninitialized-13.C: Add -fno-tree-vectorize.

gcc/testsuite/g++.dg/warn/Wuninitialized-13.C

index 210e74c..b74a2fa 100644 (file)
@@ -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;
 };