re PR tree-optimization/71026 (Missing division optimizations)
authorJackson Woodruff <jackson.woodruff@arm.com>
Fri, 15 Sep 2017 16:17:55 +0000 (16:17 +0000)
committerJeff Law <law@gcc.gnu.org>
Fri, 15 Sep 2017 16:17:55 +0000 (10:17 -0600)
2017-09-15  Jackson Woodruff  <jackson.woodruff@arm.com>

PR tree-optimization/71026
* match.pd: Move RDIV patterns from fold-const.c
* fold-const.c (distribute_real_division): Removed.
(fold_binary_loc): Remove calls to distribute_real_divison.

PR tree-optimization/71026
* gcc/testsuire/gcc.dg/fold-div-1.c: Use -O1.

From-SVN: r252827

gcc/ChangeLog
gcc/match.pd
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/fold-div-1.c

index 71191121ce31ff8b965c0adc9e20ecf789c24718..7147d5d1671ecec063c30458f1725c67111605c0 100644 (file)
@@ -1,3 +1,10 @@
+2017-09-15  Jackson Woodruff  <jackson.woodruff@arm.com>
+
+       PR tree-optimization/71026
+       * match.pd: Move RDIV patterns from fold-const.c
+       * fold-const.c (distribute_real_division): Removed.
+       (fold_binary_loc): Remove calls to distribute_real_divison.
+
 2017-09-15  Jakub Jelinek  <jakub@redhat.com>
 
        * doc/invoke.texi: Document -std=c++17 and -std=gnu++17 and document
index dbfceaf10a555c3ee86cbea864e4b058c26aaeeb..e9017e41f20eeca21275623dc25e969162b3533f 100644 (file)
@@ -3517,6 +3517,13 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
   (if (!HONOR_SNANS (type))
    @0))
 
+ (for op (plus minus)
+  /* Simplify (A / C) +- (B / C) -> (A +- B) / C.  */
+  (simplify
+   (op (rdiv @0 @1)
+       (rdiv @2 @1))
+   (rdiv (op @0 @2) @1)))
+
  /* Simplify sqrt(x) * sqrt(y) -> sqrt(x*y).  */
  (for root (SQRT CBRT)
   (simplify
index e53e7be5d64882fab2d9b120aabd6978c43490d5..240544f036a4bf6421ce0ee7d125d5827b0ef771 100644 (file)
@@ -1,3 +1,8 @@
+2017-09-15  Jackson Woodruff  <jackson.woodruff@arm.com>
+
+       PR tree-optimization/71026
+       * gcc/testsuire/gcc.dg/fold-div-1.c: Use -O1.
+
 2017-09-15  Jakub Jelinek  <jakub@redhat.com>
 
        * lib/g++-dg.exp (g++-dg-runtest): Use 17 instead of 1z.
index c1c7250f882cfed7705ba60994e47440580f4c76..73b75861166f40733d9768e9703664d51ee1a9ef 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-funsafe-math-optimizations -fdump-tree-gimple" } */
+/* { dg-options "-O1 -funsafe-math-optimizations -fdump-tree-gimple" } */
 
 float f(float x)
 {