diff options
author | Richard Biener <rguenther@suse.de> | 2013-05-03 11:09:59 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2013-05-03 11:09:59 +0000 |
commit | 07bfc9ece12554016cf8c39b17301ab94df6f176 (patch) | |
tree | 7d533f06f94bafb5dd09f062d0ef17a1ab83a989 /gcc/tree-dfa.c | |
parent | 7769bb64f35fea465d47288bcc8dae542257162f (diff) | |
download | gcc-07bfc9ece12554016cf8c39b17301ab94df6f176.zip gcc-07bfc9ece12554016cf8c39b17301ab94df6f176.tar.gz gcc-07bfc9ece12554016cf8c39b17301ab94df6f176.tar.bz2 |
double-int.h (lshift): New overload without precision and arith argument.
2013-05-03 Richard Biener <rguenther@suse.de>
* double-int.h (lshift): New overload without precision
and arith argument.
(operator *=, operator +=, operator -=): Move ...
* double-int.c (operator *=, operator +=, operator -=): ... here
and implement more efficiently.
(mul_double_with_sign): Remove.
(lshift_double): Adjust to take unsinged shift argument, push
dispatching code to callers.
(mul_double_wide_with_sign): Add early out for callers that
are not interested in high parts or overflow.
(lshift): New function.
(lshift, rshift, alshift, arshift, llshift, lrshift): Add
dispatch code here.
(lrotate, rrotate): Use logical shifts.
* expr.c (get_inner_reference): Use lshift.
* fixed-value.c (do_fixed_divide): Likewise.
* tree-dfa.c (get_ref_base_and_extent): Likewise.
* tree-ssa-alias.c (indirect_ref_may_alias_decl_p): Likewise.
(indirect_refs_may_alias_p): Likewise.
(stmt_kills_ref_p_1): Likewise.
From-SVN: r198576
Diffstat (limited to 'gcc/tree-dfa.c')
-rw-r--r-- | gcc/tree-dfa.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/gcc/tree-dfa.c b/gcc/tree-dfa.c index 23fae4f..57aae95 100644 --- a/gcc/tree-dfa.c +++ b/gcc/tree-dfa.c @@ -433,9 +433,8 @@ get_ref_base_and_extent (tree exp, HOST_WIDE_INT *poffset, if (this_offset && TREE_CODE (this_offset) == INTEGER_CST) { double_int doffset = tree_to_double_int (this_offset); - doffset = doffset.alshift (BITS_PER_UNIT == 8 - ? 3 : exact_log2 (BITS_PER_UNIT), - HOST_BITS_PER_DOUBLE_INT); + doffset = doffset.lshift (BITS_PER_UNIT == 8 + ? 3 : exact_log2 (BITS_PER_UNIT)); doffset += tree_to_double_int (DECL_FIELD_BIT_OFFSET (field)); bit_offset = bit_offset + doffset; @@ -501,9 +500,8 @@ get_ref_base_and_extent (tree exp, HOST_WIDE_INT *poffset, = (TREE_INT_CST (index) - TREE_INT_CST (low_bound)) .sext (TYPE_PRECISION (TREE_TYPE (index))); doffset *= tree_to_double_int (unit_size); - doffset = doffset.alshift (BITS_PER_UNIT == 8 - ? 3 : exact_log2 (BITS_PER_UNIT), - HOST_BITS_PER_DOUBLE_INT); + doffset = doffset.lshift (BITS_PER_UNIT == 8 + ? 3 : exact_log2 (BITS_PER_UNIT)); bit_offset = bit_offset + doffset; /* An array ref with a constant index up in the structure @@ -552,9 +550,8 @@ get_ref_base_and_extent (tree exp, HOST_WIDE_INT *poffset, else { double_int off = mem_ref_offset (exp); - off = off.alshift (BITS_PER_UNIT == 8 - ? 3 : exact_log2 (BITS_PER_UNIT), - HOST_BITS_PER_DOUBLE_INT); + off = off.lshift (BITS_PER_UNIT == 8 + ? 3 : exact_log2 (BITS_PER_UNIT)); off = off + bit_offset; if (off.fits_shwi ()) { @@ -583,9 +580,8 @@ get_ref_base_and_extent (tree exp, HOST_WIDE_INT *poffset, else { double_int off = mem_ref_offset (exp); - off = off.alshift (BITS_PER_UNIT == 8 - ? 3 : exact_log2 (BITS_PER_UNIT), - HOST_BITS_PER_DOUBLE_INT); + off = off.lshift (BITS_PER_UNIT == 8 + ? 3 : exact_log2 (BITS_PER_UNIT)); off += bit_offset; if (off.fits_shwi ()) { |