summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-math-opts.c
diff options
context:
space:
mode:
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2011-08-18 11:30:42 +0000
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2011-08-18 11:30:42 +0000
commitb1757d46a6ec2a81b4e2cb78df5ec3e2e5567d5e (patch)
treefbdfd26aa897edd883893073cf2f3b2ed9769b4a /gcc/tree-ssa-math-opts.c
parent2ad5f5fc44b63e7b56516a47ca7417ea74d7d162 (diff)
downloadgcc-b1757d46a6ec2a81b4e2cb78df5ec3e2e5567d5e.tar.gz
2011-08-18 Paolo Carlini <paolo.carlini@oracle.com>
Joseph Myers <joseph@codesourcery.com> PR tree-optimization/49963 * hwint.c (absu_hwi): Define. * hwint.h (absu_hwi): Declare. * fold-const.c (fold_plusminus_mult_expr): Use absu_hwi instead of abs_hwi. * tree-ssa-math-opts.c (gimple_expand_builtin_pow): Likewise. * tree-ssa-loop-prefetch.c (prune_ref_by_group_reuse): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@177848 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-math-opts.c')
-rw-r--r--gcc/tree-ssa-math-opts.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/gcc/tree-ssa-math-opts.c b/gcc/tree-ssa-math-opts.c
index 63cc175eadd..db4ec44c331 100644
--- a/gcc/tree-ssa-math-opts.c
+++ b/gcc/tree-ssa-math-opts.c
@@ -1231,7 +1231,7 @@ gimple_expand_builtin_pow (gimple_stmt_iterator *gsi, location_t loc,
/* Attempt to fold powi(arg0, abs(n/2)) into multiplies. If not
possible or profitable, give up. Skip the degenerate case when
n is 1 or -1, where the result is always 1. */
- if (abs_hwi (n) != 1)
+ if (absu_hwi (n) != 1)
{
powi_x_ndiv2 = gimple_expand_builtin_powi (gsi, loc, arg0,
abs_hwi (n / 2));
@@ -1243,7 +1243,7 @@ gimple_expand_builtin_pow (gimple_stmt_iterator *gsi, location_t loc,
result of the optimal multiply sequence just calculated. */
sqrt_arg0 = build_and_insert_call (gsi, loc, &target, sqrtfn, arg0);
- if (abs_hwi (n) == 1)
+ if (absu_hwi (n) == 1)
result = sqrt_arg0;
else
result = build_and_insert_binop (gsi, loc, target, MULT_EXPR,
@@ -1285,7 +1285,7 @@ gimple_expand_builtin_pow (gimple_stmt_iterator *gsi, location_t loc,
/* Attempt to fold powi(arg0, abs(n/3)) into multiplies. If not
possible or profitable, give up. Skip the degenerate case when
abs(n) < 3, where the result is always 1. */
- if (abs_hwi (n) >= 3)
+ if (absu_hwi (n) >= 3)
{
powi_x_ndiv3 = gimple_expand_builtin_powi (gsi, loc, arg0,
abs_hwi (n / 3));
@@ -1298,14 +1298,14 @@ gimple_expand_builtin_pow (gimple_stmt_iterator *gsi, location_t loc,
either cbrt(x) or cbrt(x) * cbrt(x). */
cbrt_x = build_and_insert_call (gsi, loc, &target, cbrtfn, arg0);
- if (abs_hwi (n) % 3 == 1)
+ if (absu_hwi (n) % 3 == 1)
powi_cbrt_x = cbrt_x;
else
powi_cbrt_x = build_and_insert_binop (gsi, loc, target, MULT_EXPR,
cbrt_x, cbrt_x);
/* Multiply the two subexpressions, unless powi(x,abs(n)/3) = 1. */
- if (abs_hwi (n) < 3)
+ if (absu_hwi (n) < 3)
result = powi_cbrt_x;
else
result = build_and_insert_binop (gsi, loc, target, MULT_EXPR,