+2018-03-06 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/84687
+ * omp-simd-clone.c (simd_clone_create): Clear DECL_BUILT_IN_CLASS
+ on new_node->decl.
+ * match.pd (pow(C,x)*expN(y) -> expN(logN(C)*x+y)): New optimization.
+
2018-03-05 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
* config/rs6000/rs6000-builtin.def (rs6000_speculation_barrier):
(exps (mult (logs @0) @1))
(exp2s (mult (log2s @0) @1)))))))
+ /* pow(C,x)*expN(y) -> expN(logN(C)*x+y) if C > 0. */
+ (for pows (POW)
+ exps (EXP EXP2 EXP10 POW10)
+ logs (LOG LOG2 LOG10 LOG10)
+ (simplify
+ (mult:c (pows:s REAL_CST@0 @1) (exps:s @2))
+ (if (real_compare (GT_EXPR, TREE_REAL_CST_PTR (@0), &dconst0)
+ && real_isfinite (TREE_REAL_CST_PTR (@0)))
+ (exps (plus (mult (logs @0) @1) @2)))))
+
(for sqrts (SQRT)
cbrts (CBRT)
pows (POW)
if (new_node == NULL)
return new_node;
+ DECL_BUILT_IN_CLASS (new_node->decl) = NOT_BUILT_IN;
+ DECL_FUNCTION_CODE (new_node->decl) = (enum built_in_function) 0;
TREE_PUBLIC (new_node->decl) = TREE_PUBLIC (old_node->decl);
DECL_COMDAT (new_node->decl) = DECL_COMDAT (old_node->decl);
DECL_WEAK (new_node->decl) = DECL_WEAK (old_node->decl);
+2018-03-06 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/84687
+ * gcc.dg/pr84687.c: New test.
+
2018-03-06 Alexandre Oliva <aoliva@redhat.com>
PR c++/84231
--- /dev/null
+/* PR tree-optimization/84687 */
+/* { dg-do compile } */
+/* { dg-options "-Ofast" } */
+
+int a[64], b;
+double pow (double, double);
+__attribute__((__simd__)) double exp (double);
+
+void
+foo (double x)
+{
+ int i;
+ double c = exp (x);
+ for (i = 0; i < 64; i++)
+ {
+ b = i;
+ a[i] = pow (12.0, b) * pow (c, i);
+ }
+}