This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/49361] New: [4.7 Regression] Huge 470.lbm regression
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 10 Jun 2011 10:59:05 +0000
- Subject: [Bug tree-optimization/49361] New: [4.7 Regression] Huge 470.lbm regression
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49361
Summary: [4.7 Regression] Huge 470.lbm regression
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Keywords: missed-optimization
Severity: normal
Priority: P3
Component: tree-optimization
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: rguenth@gcc.gnu.org
CC: wschmidt@gcc.gnu.org
+2011-06-06 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
+
+ PR tree-optimization/46728
+ * builtins.c (powi_table): Remove.
+ (powi_lookup_cost): Remove.
+ (powi_cost): Remove.
+ (expand_powi_1): Remove.
+ (expand_powi): Remove.
+ (expand_builtin_pow_root): Remove.
+ (expand_builtin_pow): Remove.
+ (expand_builtin_powi): Eliminate handling of constant exponent.
+ (expand_builtin): Use expand_builtin_mathfn_2 for BUILT_IN_POW.
caused a buge 470.lbm performance regression at -O3 -ffast-math.
This is because when PRE inserts an expression like x * x it folds it,
producing
pow (x, 2.0) again which is then never expanded to x * x again.
PRE does this folding in create_expression_by_pieces.
Arguably not the very best idea.
Eventually we should simply do
Index: gcc/fold-const.c
===================================================================
--- gcc/fold-const.c (revision 174891)
+++ gcc/fold-const.c (working copy)
@@ -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);