diff options
author | Martin Sebor <msebor@redhat.com> | 2017-12-06 19:22:55 +0000 |
---|---|---|
committer | Martin Sebor <msebor@gcc.gnu.org> | 2017-12-06 12:22:55 -0700 |
commit | bf8ce85a42258d0fd7c7d20362af55c243045e45 (patch) | |
tree | f81c9828b959af2e87e4ae45a632989e8dab660e | |
parent | d7f44d4d00640240af8731911eed207eca5ac4d0 (diff) | |
download | gcc-bf8ce85a42258d0fd7c7d20362af55c243045e45.zip gcc-bf8ce85a42258d0fd7c7d20362af55c243045e45.tar.gz gcc-bf8ce85a42258d0fd7c7d20362af55c243045e45.tar.bz2 |
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
-rw-r--r-- | gcc/testsuite/ChangeLog | 3 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/opt/new1.C | 9 |
2 files changed, 11 insertions, 1 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 782e04d..3ad19f0 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -9,6 +9,9 @@ 2017-12-06 Martin Sebor <msebor@redhat.com> + 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 d0f7d95..22bd5c3 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 <typename T> void QScript::Buffer<T>::resize(int s) { reserve (s << 1); } template <typename T> void QScript::Buffer<T>::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<m_size; ++i) new_data[i] = m_data[i]; @@ -69,3 +74,5 @@ namespace QScript { } } } + +// { dg-prune-output "\\\[-Walloc-size-larger-than=]" } |