re PR tree-optimization/49361 (Huge 470.lbm regression)
authorRichard Guenther <rguenther@suse.de>
Fri, 10 Jun 2011 12:19:30 +0000 (12:19 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Fri, 10 Jun 2011 12:19:30 +0000 (12:19 +0000)
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

gcc/ChangeLog
gcc/fold-const.c

index d64b513128a8fb5ed6fc5369822b7a51e584ded7..29a87a345418762651ec711c7886a788a71a7592 100644 (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
index 9a3f8cb0fecf5c0c788b0388ad9fdac286675fdf..e1a497eda9657ac9f7f9eec65f5896e218d5dc2a 100644 (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);