]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/59255 (Segmentation fault with std::function and -fprofile-use)
authorJakub Jelinek <jakub@redhat.com>
Fri, 20 Dec 2013 16:32:21 +0000 (17:32 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 20 Dec 2013 16:32:21 +0000 (17:32 +0100)
PR c++/59255
* g++.dg/tree-prof/pr59255.C: New test.

From-SVN: r206152

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/tree-prof/pr59255.C [new file with mode: 0644]

index 95afd48500695916bed4cdeb518da68c23d0a3b5..73f0cb904a289ac9b999bff96e72eea5fc5e9abf 100644 (file)
@@ -1,3 +1,8 @@
+2013-12-20  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/59255
+       * g++.dg/tree-prof/pr59255.C: New test.
+
 2013-12-20  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
 
        * 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 (file)
index 0000000..eb2b51f
--- /dev/null
@@ -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;
+    }
+}