re PR tree-optimization/56125 (-O2 -ffast-math generates bad code when dividing a...
authorJakub Jelinek <jakub@gcc.gnu.org>
Mon, 28 Jan 2013 14:43:03 +0000 (15:43 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Mon, 28 Jan 2013 14:43:03 +0000 (15:43 +0100)
commit0bfbca5868fae1912db33ae4ab341d6e08bd68b4
tree2a2bfc3d290925073d4af913ae01b69cfbf1aa53
parentdd8b9ddea2288c96124367bf66ce060eb1049872
re PR tree-optimization/56125 (-O2 -ffast-math generates bad code when dividing a double by the square of another double.)

PR tree-optimization/56125
* tree-ssa-math-opts.c (gimple_expand_builtin_pow): Don't optimize
pow(x,c) into sqrt(x) * powi(x, n/2) or
1.0 / (sqrt(x) * powi(x, abs(n/2))) if c is an integer or when
optimizing for size.
Don't optimize pow(x,c) into powi(x, n/3) * powi(cbrt(x), n%3) or
1.0 / (powi(x, abs(n)/3) * powi(cbrt(x), abs(n)%3)) if 2c is an
integer.

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

From-SVN: r195507
gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr56125.c [new file with mode: 0644]
gcc/tree-ssa-math-opts.c