diff options
author | Richard Sandiford <richard.sandiford@linaro.org> | 2017-10-09 10:51:45 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2017-10-09 10:51:45 +0000 |
commit | 7b27cb4b510c4c0ae8446140929380aba4a9f79a (patch) | |
tree | f4ff87714e14c46a92572a3688e8ec637e80ea78 /gcc/expr.c | |
parent | 191411e43abdefb0c999215bf081d4a5776f281a (diff) | |
download | gcc-7b27cb4b510c4c0ae8446140929380aba4a9f79a.zip gcc-7b27cb4b510c4c0ae8446140929380aba4a9f79a.tar.gz gcc-7b27cb4b510c4c0ae8446140929380aba4a9f79a.tar.bz2 |
Allow non-wi <op> wi
This patch uses global rather than member operators for wide-int.h,
so that the first operand can be a non-wide-int type.
The patch also removes the and_not and or_not member functions.
It was already inconsistent to have member functions for these
two operations (one of which was never used) and not other wi::
ones like udiv. After the operator change, we'd have the additional
inconsistency that "non-wi & wi" would work but "non-wi.and_not (wi)"
wouldn't.
2017-10-09 Richard Sandiford <richard.sandiford@linaro.org>
gcc/
* wide-int.h (WI_BINARY_OPERATOR_RESULT): New macro.
(WI_BINARY_PREDICATE_RESULT): Likewise.
(wi::binary_traits::operator_result): New type.
(wi::binary_traits::predicate_result): Likewise.
(generic_wide_int::operator~, unary generic_wide_int::operator-)
(generic_wide_int::operator==, generic_wide_int::operator!=)
(generic_wide_int::operator&, generic_wide_int::and_not)
(generic_wide_int::operator|, generic_wide_int::or_not)
(generic_wide_int::operator^, generic_wide_int::operator+
(binary generic_wide_int::operator-, generic_wide_int::operator*):
Delete.
(operator~, unary operator-, operator==, operator!=, operator&)
(operator|, operator^, operator+, binary operator-, operator*): New
functions.
* expr.c (get_inner_reference): Use wi::bit_and_not.
* fold-const.c (fold_binary_loc): Likewise.
* ipa-prop.c (ipa_compute_jump_functions_for_edge): Likewise.
* tree-ssa-ccp.c (get_value_from_alignment): Likewise.
(bit_value_binop): Likewise.
* tree-ssa-math-opts.c (find_bswap_or_nop_load): Likewise.
* tree-vrp.c (zero_nonzero_bits_from_vr): Likewise.
(extract_range_from_binary_expr_1): Likewise.
(masked_increment): Likewise.
(simplify_bit_ops_using_ranges): Likewise.
From-SVN: r253539
Diffstat (limited to 'gcc/expr.c')
-rw-r--r-- | gcc/expr.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -7153,7 +7153,7 @@ get_inner_reference (tree exp, HOST_WIDE_INT *pbitsize, if (wi::neg_p (bit_offset) || !wi::fits_shwi_p (bit_offset)) { offset_int mask = wi::mask <offset_int> (LOG2_BITS_PER_UNIT, false); - offset_int tem = bit_offset.and_not (mask); + offset_int tem = wi::bit_and_not (bit_offset, 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; |