From: Martin Sebor Date: Wed, 6 Dec 2017 19:22:55 +0000 (+0000) Subject: PR testsuite/83303 - FAIL: g++.dg/opt/new1.C on arm-none-eabi X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=bf8ce85a42258d0fd7c7d20362af55c243045e45;p=gcc.git PR testsuite/83303 - FAIL: g++.dg/opt/new1.C on arm-none-eabi PR testsuite/83303 - FAIL: g++.dg/opt/new1.C on arm-none-eabi (extra -Walloc-size-larger-than warning * g++.dg/opt/new1.C: Prune warning from test output. From-SVN: r255450 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 782e04d3639..3ad19f056ec 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -9,6 +9,9 @@ 2017-12-06 Martin Sebor + PR testsuite/83303 + * g++.dg/opt/new1.C: Prune warning from test output. + PR tree-optimization/82646 * gcc.dg/builtin-stringop-chk-1.c: Adjust. * gcc.dg/builtin-stringop-chk-9.c: New test. diff --git a/gcc/testsuite/g++.dg/opt/new1.C b/gcc/testsuite/g++.dg/opt/new1.C index d0f7d95b655..22bd5c3920a 100644 --- a/gcc/testsuite/g++.dg/opt/new1.C +++ b/gcc/testsuite/g++.dg/opt/new1.C @@ -1,4 +1,4 @@ -// PR c++/39367 +// PR c++/39367 - ICE at tree-inline.c:1042 with -O // { dg-options "-O" } class QScriptEnginePrivate; @@ -37,6 +37,11 @@ template void QScript::Buffer::resize(int s) { reserve (s << 1); } template void QScript::Buffer::reserve(int x) { + /* The following may be optimized into a trap because the function + is called from resize(0) and so with m_capacity < 0. When not + optimized it may trigger -Walloc-size-larger-than= since + operator new() is called with an excessively large value. + The warning is pruned from the test output below. */ T *new_data = new T[m_capacity]; for (int i=0; i