diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7ff6c0c6e04..efb5505be10 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2008-08-03 Jan Hubicka + + * optabs.c (expand_binop, expand_builtin_pow, expand_builtin_powi, + expand_builtin_strcat): Upse optimize_insn_for_speed predicate. + * expmed.c (expand_smod_pow2): Likewise. + 2008-08-03 Uros Bizjak PR target/36992 diff --git a/gcc/builtins.c b/gcc/builtins.c index 2dffd53e604..953fb7bddc6 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -2911,7 +2911,7 @@ expand_builtin_pow (tree exp, rtx target, rtx subtarget) if (real_identical (&c, &cint) && ((n >= -1 && n <= 2) || (flag_unsafe_math_optimizations - && !optimize_size + && optimize_insn_for_speed_p () && powi_cost (n) <= POWI_MAX_MULTS))) { op = expand_expr (arg0, subtarget, VOIDmode, EXPAND_NORMAL); @@ -2935,7 +2935,7 @@ expand_builtin_pow (tree exp, rtx target, rtx subtarget) real_from_integer (&cint, VOIDmode, n, n < 0 ? -1 : 0, 0); if (real_identical (&c2, &cint) && ((flag_unsafe_math_optimizations - && !optimize_size + && optimize_insn_for_speed_p () && powi_cost (n/2) <= POWI_MAX_MULTS) || n == 1)) { @@ -2980,7 +2980,7 @@ expand_builtin_pow (tree exp, rtx target, rtx subtarget) real_arithmetic (&c2, RDIV_EXPR, &cint, &dconst3); real_convert (&c2, mode, &c2); if (real_identical (&c2, &c) - && ((!optimize_size + && ((optimize_insn_for_speed_p () && powi_cost (n/3) <= POWI_MAX_MULTS) || n == 1)) { @@ -3042,7 +3042,7 @@ expand_builtin_powi (tree exp, rtx target, rtx subtarget) if ((TREE_INT_CST_HIGH (arg1) == 0 || TREE_INT_CST_HIGH (arg1) == -1) && ((n >= -1 && n <= 2) - || (! optimize_size + || (optimize_insn_for_speed_p () && powi_cost (n) <= POWI_MAX_MULTS))) { op0 = expand_expr (arg0, subtarget, VOIDmode, EXPAND_NORMAL); @@ -4464,7 +4464,7 @@ expand_builtin_strcat (tree fndecl, tree exp, rtx target, enum machine_mode mode if (p && *p == '\0') return expand_expr (dst, target, mode, EXPAND_NORMAL); - if (!optimize_size) + if (optimize_insn_for_speed_p ()) { /* See if we can store by pieces into (dst + strlen(dst)). */ tree newsrc, newdst, diff --git a/gcc/expmed.c b/gcc/expmed.c index d5127b3c344..b102241dbb1 100644 --- a/gcc/expmed.c +++ b/gcc/expmed.c @@ -3487,7 +3487,7 @@ expand_smod_pow2 (enum machine_mode mode, rtx op0, HOST_WIDE_INT d) /* Avoid conditional branches when they're expensive. */ if (BRANCH_COST >= 2 - && !optimize_size) + && optimize_insn_for_speed_p ()) { rtx signmask = emit_store_flag (result, LT, op0, const0_rtx, mode, 0, -1); diff --git a/gcc/optabs.c b/gcc/optabs.c index ee5bec11a41..158e75999d8 100644 --- a/gcc/optabs.c +++ b/gcc/optabs.c @@ -1786,7 +1786,7 @@ expand_binop (enum machine_mode mode, optab binoptab, rtx op0, rtx op1, if ((binoptab == lshr_optab || binoptab == ashl_optab || binoptab == ashr_optab) && mclass == MODE_INT - && (GET_CODE (op1) == CONST_INT || !optimize_size) + && (GET_CODE (op1) == CONST_INT || optimize_insn_for_speed_p ()) && GET_MODE_SIZE (mode) == 2 * UNITS_PER_WORD && optab_handler (binoptab, word_mode)->insn_code != CODE_FOR_nothing && optab_handler (ashl_optab, word_mode)->insn_code != CODE_FOR_nothing