Commit 16ef0a8c by Jakub Jelinek Committed by Jakub Jelinek

re PR tree-optimization/84687 (error: invalid conversion in gimple call with -O3 and -ffast-math)

	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.

	* gcc.dg/pr84687.c: New test.

From-SVN: r258272
parent 23d63b45
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):
......
......@@ -4030,6 +4030,16 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
(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)
......
......@@ -456,6 +456,8 @@ simd_clone_create (struct cgraph_node *old_node)
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
......
/* 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);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment