summaryrefslogtreecommitdiff
path: root/gcc/fold-const.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2011-06-10 12:19:30 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2011-06-10 12:19:30 +0000
commit3050df3e388b3e44f04a69bf9b1a593a1e33d0af (patch)
treeeb3483391707f9daf8809624bb34f846854ef083 /gcc/fold-const.c
parent5715c09b3d628b3ec8abea375f09a4d46386a13a (diff)
downloadgcc-3050df3e388b3e44f04a69bf9b1a593a1e33d0af.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@174903 138bc75d-0d04-0410-961f-82ee72b054a4
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 9a3f8cb0fec..e1a497eda96 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);