From bd440a8c1c50b20b6eac028bca1fc682159787ba Mon Sep 17 00:00:00 2001 From: liuhongt Date: Wed, 13 Oct 2021 10:05:58 +0800 Subject: [PATCH] Adjust testcase for O2 vectorization[Wuninitialized] 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 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gcc/testsuite/g++.dg/warn/Wuninitialized-13.C b/gcc/testsuite/g++.dg/warn/Wuninitialized-13.C index 210e74c..b74a2fa 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; }; -- 2.7.4