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
This commit is contained in:
Richard Guenther 2011-06-10 12:19:30 +00:00 committed by Richard Biener
parent dae957ae75
commit 7871eee372
2 changed files with 8 additions and 1 deletions

View File

@ -1,3 +1,9 @@
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.
2011-06-10 Richard Guenther <rguenther@suse.de>
PR bootstrap/49344

View File

@ -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);