Commit 9aa484f5 by Jakub Jelinek Committed by Jakub Jelinek

re PR middle-end/84309 (Wrong-code with -ffast-math)

	PR middle-end/84309
	* match.pd (pow(C,x) -> exp(log(C)*x)): Use exp2s and log2s instead
	of exps and logs in the use_exp2 case.

	* gcc.dg/pr84309-2.c: New test.

From-SVN: r257634
parent 43edc4f5
2018-02-13 Jakub Jelinek <jakub@redhat.com>
PR middle-end/84309
* match.pd (pow(C,x) -> exp(log(C)*x)): Use exp2s and log2s instead
of exps and logs in the use_exp2 case.
2018-02-13 Jeff Law <law@redhat.com> 2018-02-13 Jeff Law <law@redhat.com>
* config/rl/rl78.c (rl78_attribute_table): Fix terminator and * config/rl/rl78.c (rl78_attribute_table): Fix terminator and
......
...@@ -4021,7 +4021,7 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT) ...@@ -4021,7 +4021,7 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
/* As libmvec doesn't have a vectorized exp2, defer optimizing /* As libmvec doesn't have a vectorized exp2, defer optimizing
this until after vectorization. */ this until after vectorization. */
(if (canonicalize_math_after_vectorization_p ()) (if (canonicalize_math_after_vectorization_p ())
(exps (mult (logs @0) @1)))))))) (exp2s (mult (log2s @0) @1))))))))
(for sqrts (SQRT) (for sqrts (SQRT)
cbrts (CBRT) cbrts (CBRT)
......
2018-02-13 Jakub Jelinek <jakub@redhat.com>
PR middle-end/84309
* gcc.dg/pr84309-2.c: New test.
2018-02-12 Richard Sandiford <richard.sandiford@linaro.org> 2018-02-12 Richard Sandiford <richard.sandiford@linaro.org>
PR tree-optimization/84321 PR tree-optimization/84321
......
/* PR middle-end/84309 */
/* { dg-do compile } */
/* { dg-options "-Ofast -fdump-tree-optimized" } */
double
foo (double x)
{
return __builtin_pow (2.0, x);
}
/* { dg-final { scan-tree-dump "__builtin_exp2 " "optimized" { target *-*-linux* *-*-gnu* } } } */
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