Adjust testcase for O2 vectorization[Wuninitialized]
Commit Message
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(-)
@@ -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;
};