aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-ccp.c
diff options
context:
space:
mode:
authorPrathamesh Kulkarni <prathamesh.kulkarni@linaro.org>2016-08-06 18:11:24 +0000
committerPrathamesh Kulkarni <prathamesh3492@gcc.gnu.org>2016-08-06 18:11:24 +0000
commit19278b02d711d178cce78033a5a95ffeccbae42d (patch)
tree70ffd34e11596b0b92f8ebdceb4c25ea8bb189da /gcc/tree-ssa-ccp.c
parente7864d68ee80371a51f3667dc0b2102c344b41c0 (diff)
downloadgcc-19278b02d711d178cce78033a5a95ffeccbae42d.zip
gcc-19278b02d711d178cce78033a5a95ffeccbae42d.tar.gz
gcc-19278b02d711d178cce78033a5a95ffeccbae42d.tar.bz2
tree-ssa-ccp.c (extend_mask): New param sgn.
2016-08-08 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org> * tree-ssa-ccp.c (extend_mask): New param sgn. Remove ORing with wi::mask. (get_default_value): Adjust call to extend_mask to pass sign. (evaluate_stmt): Likewise. From-SVN: r239212
Diffstat (limited to 'gcc/tree-ssa-ccp.c')
-rw-r--r--gcc/tree-ssa-ccp.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/gcc/tree-ssa-ccp.c b/gcc/tree-ssa-ccp.c
index ae120a8..5d5386e 100644
--- a/gcc/tree-ssa-ccp.c
+++ b/gcc/tree-ssa-ccp.c
@@ -231,13 +231,12 @@ debug_lattice_value (ccp_prop_value_t val)
fprintf (stderr, "\n");
}
-/* Extend NONZERO_BITS to a full mask, with the upper bits being set. */
+/* Extend NONZERO_BITS to a full mask, based on sgn. */
static widest_int
-extend_mask (const wide_int &nonzero_bits)
+extend_mask (const wide_int &nonzero_bits, signop sgn)
{
- return (wi::mask <widest_int> (wi::get_precision (nonzero_bits), true)
- | widest_int::from (nonzero_bits, UNSIGNED));
+ return widest_int::from (nonzero_bits, sgn);
}
/* Compute a default value for variable VAR and store it in the
@@ -287,7 +286,7 @@ get_default_value (tree var)
{
val.lattice_val = CONSTANT;
val.value = build_zero_cst (TREE_TYPE (var));
- val.mask = extend_mask (nonzero_bits);
+ val.mask = extend_mask (nonzero_bits, TYPE_SIGN (TREE_TYPE (var)));
}
}
}
@@ -1937,7 +1936,7 @@ evaluate_stmt (gimple *stmt)
{
val.lattice_val = CONSTANT;
val.value = build_zero_cst (TREE_TYPE (lhs));
- val.mask = extend_mask (nonzero_bits);
+ val.mask = extend_mask (nonzero_bits, TYPE_SIGN (TREE_TYPE (lhs)));
is_constant = true;
}
else
@@ -1948,7 +1947,8 @@ evaluate_stmt (gimple *stmt)
if (nonzero_bits == 0)
val.mask = 0;
else
- val.mask = val.mask & extend_mask (nonzero_bits);
+ val.mask = val.mask & extend_mask (nonzero_bits,
+ TYPE_SIGN (TREE_TYPE (lhs)));
}
}
}