diff options
author | rsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-04-23 14:46:35 +0000 |
---|---|---|
committer | rsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-04-23 14:46:35 +0000 |
commit | 885a26948e348571c7236f6356b7757b730e1b14 (patch) | |
tree | 245545697f281f0a40d4eb7de7e709711d91bb19 /gcc/expr.c | |
parent | 265815a249c2e0481564e204fd90270e1fbea8fd (diff) | |
download | gcc-885a26948e348571c7236f6356b7757b730e1b14.tar.gz |
Use LOG2_BITS_PER_UNIT.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/wide-int@209700 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/expr.c')
-rw-r--r-- | gcc/expr.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/gcc/expr.c b/gcc/expr.c index d71622b3e99..1ad602707cd 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -6801,8 +6801,7 @@ get_inner_reference (tree exp, HOST_WIDE_INT *pbitsize, if (!integer_zerop (off)) { offset_int boff, coff = mem_ref_offset (exp); - boff = wi::lshift (coff, (BITS_PER_UNIT == 8 - ? 3 : exact_log2 (BITS_PER_UNIT))); + boff = wi::lshift (coff, LOG2_BITS_PER_UNIT); bit_offset += boff; } exp = TREE_OPERAND (TREE_OPERAND (exp, 0), 0); @@ -6828,8 +6827,7 @@ get_inner_reference (tree exp, HOST_WIDE_INT *pbitsize, { offset_int tem = wi::sext (wi::to_offset (offset), TYPE_PRECISION (sizetype)); - tem = wi::lshift (tem, (BITS_PER_UNIT == 8 - ? 3 : exact_log2 (BITS_PER_UNIT))); + tem = wi::lshift (tem, LOG2_BITS_PER_UNIT); tem += bit_offset; if (wi::fits_shwi_p (tem)) { @@ -6844,16 +6842,12 @@ get_inner_reference (tree exp, HOST_WIDE_INT *pbitsize, /* Avoid returning a negative bitpos as this may wreak havoc later. */ if (wi::neg_p (bit_offset)) { - offset_int mask - = wi::mask <offset_int> (BITS_PER_UNIT == 8 - ? 3 : exact_log2 (BITS_PER_UNIT), - false); + offset_int mask = wi::mask <offset_int> (LOG2_BITS_PER_UNIT, false); offset_int tem = bit_offset.and_not (mask); /* TEM is the bitpos rounded to BITS_PER_UNIT towards -Inf. Subtract it to BIT_OFFSET and add it (scaled) to OFFSET. */ bit_offset -= tem; - tem = wi::arshift (tem, (BITS_PER_UNIT == 8 - ? 3 : exact_log2 (BITS_PER_UNIT))); + tem = wi::arshift (tem, LOG2_BITS_PER_UNIT); offset = size_binop (PLUS_EXPR, offset, wide_int_to_tree (sizetype, tem)); } |