2019-08-30 Jakub Jelinek <jakub@redhat.com>
Backported from mainline
+ 2019-04-16 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/90090
+ * tree-ssa-math-opts.c (is_division_by): Ignore divisions that can
+ throw internally.
+
2019-04-09 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/89998
2019-08-30 Jakub Jelinek <jakub@redhat.com>
Backported from mainline
+ 2019-04-16 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/90090
+ * g++.dg/opt/pr90090.C: New test.
+
2019-04-12 Jakub Jelinek <jakub@redhat.com>
PR c/89933
--- /dev/null
+// PR tree-optimization/90090
+// { dg-do compile }
+// { dg-options "-Ofast -fno-associative-math -fsignaling-nans -fno-tree-dce -fnon-call-exceptions" }
+
+double bar (double, double, double, double, double);
+double baz ();
+
+double
+foo (double a)
+{
+ try
+ {
+ return bar (1.0/a, 2.0/a, 4.0/a, 8.0/a, 16.0/a);
+ }
+ catch (...)
+ {
+ return baz ();
+ }
+}
/* Do not recognize x / x as valid division, as we are getting
confused later by replacing all immediate uses x in such
a stmt. */
- && gimple_assign_rhs1 (use_stmt) != def;
+ && gimple_assign_rhs1 (use_stmt) != def
+ && !stmt_can_throw_internal (use_stmt);
}
/* Walk the subset of the dominator tree rooted at OCC, setting the