aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2019-11-21 11:59:27 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2019-11-21 11:59:27 +0100
commit01a0fba62602d008fe838aafa0ee5b1b35369e06 (patch)
tree753363427bb25a48beabf8bf11526e1020f99d4e /gcc/testsuite
parent141793d5e91cac12a59ed3a4a8d432824ea753ee (diff)
downloadgcc-01a0fba62602d008fe838aafa0ee5b1b35369e06.zip
gcc-01a0fba62602d008fe838aafa0ee5b1b35369e06.tar.gz
gcc-01a0fba62602d008fe838aafa0ee5b1b35369e06.tar.bz2
re PR tree-optimization/91355 (optimized code does not call destructor while unwinding after exception)
PR tree-optimization/91355 * tree-ssa-sink.c (select_best_block): Use >= rather than > for early_bb scaled count with best_bb count comparison. * g++.dg/torture/pr91355.C: New test. From-SVN: r278548
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/torture/pr91355.C28
2 files changed, 33 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 5b0217c..7ff0ce7 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2019-11-21 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/91355
+ * g++.dg/torture/pr91355.C: New test.
+
2019-11-21 Iain Sandoe <iain@sandoe.co.uk>
* gcc.dg/gnu2x-attrs-1.c: Expect an error for the alias case
diff --git a/gcc/testsuite/g++.dg/torture/pr91355.C b/gcc/testsuite/g++.dg/torture/pr91355.C
new file mode 100644
index 0000000..7a385dc
--- /dev/null
+++ b/gcc/testsuite/g++.dg/torture/pr91355.C
@@ -0,0 +1,28 @@
+// PR tree-optimization/91355
+// { dg-do run }
+// { dg-options "-std=c++14" }
+
+unsigned int d = 0;
+
+struct S {
+ S () { d++; }
+ S (const S &) { d++; }
+ ~S () { d--; }
+};
+
+void
+foo (int i) throw (int) // { dg-warning "dynamic exception specifications are deprecated" }
+{
+ if (i == 0)
+ throw 3;
+ S d;
+ throw 3;
+}
+
+int
+main ()
+{
+ try { foo (1); } catch (...) {}
+ if (d)
+ __builtin_abort ();
+}