2015-08-17 Richard Biener <rguenther@suse.de>
Naveen H.S <Naveen.Hurugalawadi@caviumnetworks.com>
PR middle-end/16107
* match.pd (div (coss (op @0) : New simplifier.
Co-Authored-By: Naveen H.S <Naveen.Hurugalawadi@caviumnetworks.com>
From-SVN: r226934
+2015-08-17 Richard Biener <rguenther@suse.de>
+ Naveen H.S <Naveen.Hurugalawadi@caviumnetworks.com>
+
+ PR middle-end/16107
+ * match.pd (div (coss (op @0) : New simplifier.
+
2015-08-14 Alexandre Oliva <aoliva@redhat.com>
PR rtl-optimization/64164
(define_operator_list POW10 BUILT_IN_POW10F BUILT_IN_POW10 BUILT_IN_POW10L)
(define_operator_list SQRT BUILT_IN_SQRTF BUILT_IN_SQRT BUILT_IN_SQRTL)
(define_operator_list CBRT BUILT_IN_CBRTF BUILT_IN_CBRT BUILT_IN_CBRTL)
+(define_operator_list COS BUILT_IN_COS BUILT_IN_COSL BUILT_IN_COSF)
+(define_operator_list COSH BUILT_IN_COSH BUILT_IN_COSHL BUILT_IN_COSHF)
/* Simplifications of operations with one constant operand and
&& TYPE_OVERFLOW_UNDEFINED (type))
@0)))
+/* Simplify cos (-x) -> cos (x). */
+(for op (negate abs)
+(for coss (COS COSH)
+ (simplify
+ (coss (op @0))
+ (coss @0))))
+
/* X % Y is smaller than Y. */
(for cmp (lt ge)
(simplify
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+#include <math.h>
+
+double t (double x)
+{
+ x = -x;
+ x = cos (x);
+ x = -x;
+ x = cosh (x);
+ return x;
+}
+
+/* { dg-final { scan-tree-dump-not "-x" "optimized" } } */
+