From: Jakub Jelinek Date: Fri, 20 Dec 2013 16:32:21 +0000 (+0100) Subject: re PR c++/59255 (Segmentation fault with std::function and -fprofile-use) X-Git-Tag: releases/gcc-4.9.0~1954 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=abdd0cfa93ee92acb9498ec1a430b6d86137f7f4;p=thirdparty%2Fgcc.git re PR c++/59255 (Segmentation fault with std::function and -fprofile-use) PR c++/59255 * g++.dg/tree-prof/pr59255.C: New test. From-SVN: r206152 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 95afd4850069..73f0cb904a28 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2013-12-20 Jakub Jelinek + + PR c++/59255 + * g++.dg/tree-prof/pr59255.C: New test. + 2013-12-20 Kyrylo Tkachov * gcc.target/arm/neon-vceq_p64.c: New test. diff --git a/gcc/testsuite/g++.dg/tree-prof/pr59255.C b/gcc/testsuite/g++.dg/tree-prof/pr59255.C new file mode 100644 index 000000000000..eb2b51f7e252 --- /dev/null +++ b/gcc/testsuite/g++.dg/tree-prof/pr59255.C @@ -0,0 +1,29 @@ +// PR c++/59255 +// { dg-options "-O2 -std=c++11" } + +struct S +{ + __attribute__((noinline, noclone)) ~S () noexcept (true) + { + if (fn) + fn (1); + } + void (*fn) (int); +}; + +__attribute__((noinline, noclone)) void +foo (int x) +{ + if (x != 1) + throw 1; +} + +int +main () +{ + for (int i = 0; i < 100; i++) + { + S s; + s.fn = foo; + } +}