diff options
author | Richard Biener <rguenther@suse.de> | 2016-04-28 07:55:33 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2016-04-28 07:55:33 +0000 |
commit | cc5999c8e32f0d2ba7c73e1ec372b614064b7066 (patch) | |
tree | 02945170d12e21eff4c605520dc5fe6b15a82979 /gcc | |
parent | e1fab8ba2337fd3bdd9c7112fae22d7ab001c2eb (diff) | |
download | gcc-cc5999c8e32f0d2ba7c73e1ec372b614064b7066.zip gcc-cc5999c8e32f0d2ba7c73e1ec372b614064b7066.tar.gz gcc-cc5999c8e32f0d2ba7c73e1ec372b614064b7066.tar.bz2 |
re PR tree-optimization/70777 (x*x pessimised to pow(x,2) with -Og -ffast-math)
2016-04-28 Richard Biener <rguenther@suse.de>
PR middle-end/70777
* fold-const.c (fold_binary_loc): Remove x*x to pow(x,2.0)
canonicalization.
From-SVN: r235545
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/fold-const.c | 18 |
2 files changed, 6 insertions, 18 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4f30dd3..face26b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2016-04-28 Richard Biener <rguenther@suse.de> + + PR middle-end/70777 + * fold-const.c (fold_binary_loc): Remove x*x to pow(x,2.0) + canonicalization. + 2016-04-28 Oleg Endo <olegendo@gcc.gnu.org> * common/config/sh/sh-common.c: Remove SH5 support. diff --git a/gcc/fold-const.c b/gcc/fold-const.c index 7fc23c6..96d8484 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -10033,24 +10033,6 @@ fold_binary_loc (location_t loc, && TREE_CODE (arg1) == CONJ_EXPR && operand_equal_p (arg0, TREE_OPERAND (arg1, 0), 0)) return fold_mult_zconjz (loc, type, arg0); - - if (flag_unsafe_math_optimizations) - { - - /* Canonicalize x*x as pow(x,2.0), which is expanded as x*x. */ - if (!in_gimple_form - && optimize - && operand_equal_p (arg0, arg1, 0)) - { - tree powfn = mathfn_built_in (type, BUILT_IN_POW); - - if (powfn) - { - tree arg = build_real (type, dconst2); - return build_call_expr_loc (loc, powfn, 2, arg0, arg); - } - } - } } goto associate; |