aboutsummaryrefslogtreecommitdiff
path: root/gcc/fold-const.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2011-06-10 12:19:30 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2011-06-10 12:19:30 +0000
commit7871eee372692f471507a857b8eac77598fbdb03 (patch)
treeeb3483391707f9daf8809624bb34f846854ef083 /gcc/fold-const.c
parentdae957ae7563f1cba453d1c785a893eb8bf13d3d (diff)
downloadgcc-7871eee372692f471507a857b8eac77598fbdb03.zip
gcc-7871eee372692f471507a857b8eac77598fbdb03.tar.gz
gcc-7871eee372692f471507a857b8eac77598fbdb03.tar.bz2
re PR tree-optimization/49361 (Huge 470.lbm regression)
2011-06-10 Richard Guenther <rguenther@suse.de> PR tree-optimization/49361 * fold-const.c (fold_binary_loc): Only fold x * x to pow (x, 2.0) when not already in gimple form. From-SVN: r174903
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r--gcc/fold-const.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index 9a3f8cb..e1a497e 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -10519,7 +10519,8 @@ fold_binary_loc (location_t loc,
}
/* Optimize x*x as pow(x,2.0), which is expanded as x*x. */
- if (optimize_function_for_speed_p (cfun)
+ if (!in_gimple_form
+ && optimize_function_for_speed_p (cfun)
&& operand_equal_p (arg0, arg1, 0))
{
tree powfn = mathfn_built_in (type, BUILT_IN_POW);