poly_int: bit_field_size/offset
commite580c75cceafa22eb542314c51261889be6ca717
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 21 Dec 2017 07:01:38 +0000 (21 07:01 +0000)
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 21 Dec 2017 07:01:38 +0000 (21 07:01 +0000)
tree78865bf62d706915d434176a2fbc7d8632a24802
parent8f4bb50fd76c80a42c195d3431f9dac053740433
poly_int: bit_field_size/offset

verify_expr ensured that the size and offset in gimple BIT_FIELD_REFs
satisfied tree_fits_uhwi_p.  This patch extends that so that they can
be poly_uint64s, and adds helper routines for accessing them when the
verify_expr requirements apply.

2017-12-21  Richard Sandiford  <richard.sandiford@linaro.org>
    Alan Hayward  <alan.hayward@arm.com>
    David Sherwood  <david.sherwood@arm.com>

gcc/
* tree.h (bit_field_size, bit_field_offset): New functions.
* hsa-gen.c (gen_hsa_addr): Use them.
* tree-ssa-forwprop.c (simplify_bitfield_ref): Likewise.
(simplify_vector_constructor): Likewise.
* tree-ssa-sccvn.c (copy_reference_ops_from_ref): Likewise.
* tree-cfg.c (verify_expr): Require the sizes and offsets of a
BIT_FIELD_REF to be poly_uint64s rather than uhwis.
* fold-const.c (fold_ternary_loc): Protect tree_to_uhwi with
tree_fits_uhwi_p.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@255926 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/fold-const.c
gcc/hsa-gen.c
gcc/tree-cfg.c
gcc/tree-ssa-forwprop.c
gcc/tree-ssa-sccvn.c
gcc/tree.h