From: Richard Biener Date: Wed, 10 Nov 2021 10:08:03 +0000 (+0100) Subject: testsuite/102690 - XFAIL g++.dg/warn/Warray-bounds-16.C X-Git-Tag: releases/gcc-11.3.0~660 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3dea90505df136a4b361665772ef8e62306cfcdb;p=thirdparty%2Fgcc.git testsuite/102690 - XFAIL g++.dg/warn/Warray-bounds-16.C This XFAILs the bogus diagnostic test and rectifies the expectation on the optimization. 2021-11-10 Richard Biener PR testsuite/102690 * g++.dg/warn/Warray-bounds-16.C: XFAIL diagnostic part and optimization. (cherry picked from commit b2cd32b743ba440e75505ce30c6b5c592ed144ea) --- diff --git a/gcc/testsuite/g++.dg/warn/Warray-bounds-16.C b/gcc/testsuite/g++.dg/warn/Warray-bounds-16.C index 17b4d0d194e7..89cbadb91c7b 100644 --- a/gcc/testsuite/g++.dg/warn/Warray-bounds-16.C +++ b/gcc/testsuite/g++.dg/warn/Warray-bounds-16.C @@ -19,11 +19,11 @@ struct S p = (int*) new unsigned char [sizeof (int) * m]; for (int i = 0; i < m; i++) - new (p + i) int (); + new (p + i) int (); /* { dg-bogus "bounds" "pr102690" { xfail *-*-* } } */ } }; S a (0); -/* Verify the loop has been eliminated. - { dg-final { scan-tree-dump-not "goto" "optimized" } } */ +/* The loop cannot be eliminated since the global 'new' can change 'm'. */ +/* { dg-final { scan-tree-dump-not "goto" "optimized" { xfail *-*-* } } } */