From: Richard Guenther Date: Fri, 10 Jun 2011 12:19:30 +0000 (+0000) Subject: re PR tree-optimization/49361 (Huge 470.lbm regression) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7871eee372692f471507a857b8eac77598fbdb03;p=gcc.git re PR tree-optimization/49361 (Huge 470.lbm regression) 2011-06-10 Richard Guenther 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d64b513128a..29a87a34541 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2011-06-10 Richard Guenther + + 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. + 2011-06-10 Richard Guenther PR bootstrap/49344 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);