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: r278551
+2019-11-21 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/91355
+ * tree-ssa-sink.c (select_best_block): Use >= rather than >
+ for early_bb scaled count with best_bb count comparison.
+
2019-11-21 Richard Biener <rguenther@suse.de>
Revert
+2019-11-21 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/91355
+ * g++.dg/torture/pr91355.C: New test.
+
2019-11-20 Peter Bergner <bergner@linux.ibm.com>
Backport from mainline
--- /dev/null
+// 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 ();
+}
/* If result of comparsion is unknown, preffer EARLY_BB.
Thus use !(...>=..) rather than (...<...) */
&& !(best_bb->count.apply_scale (100, 1)
- > (early_bb->count.apply_scale (threshold, 1))))
+ >= early_bb->count.apply_scale (threshold, 1)))
return best_bb;
/* No better block found, so return EARLY_BB, which happens to be the