diff options
author | Richard Sandiford <richard.sandiford@linaro.org> | 2017-12-21 07:01:38 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2017-12-21 07:01:38 +0000 |
commit | e7301f5fcbfa649beb05da1e3508db7fc7c4d26b (patch) | |
tree | 78865bf62d706915d434176a2fbc7d8632a24802 /gcc/hsa-gen.c | |
parent | f8f667be749428f92a33d6c4ff8b56538f958c10 (diff) | |
download | gcc-e7301f5fcbfa649beb05da1e3508db7fc7c4d26b.zip gcc-e7301f5fcbfa649beb05da1e3508db7fc7c4d26b.tar.gz gcc-e7301f5fcbfa649beb05da1e3508db7fc7c4d26b.tar.bz2 |
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.
Co-Authored-By: Alan Hayward <alan.hayward@arm.com>
Co-Authored-By: David Sherwood <david.sherwood@arm.com>
From-SVN: r255926
Diffstat (limited to 'gcc/hsa-gen.c')
-rw-r--r-- | gcc/hsa-gen.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/hsa-gen.c b/gcc/hsa-gen.c index 9284a3c..155bcdf 100644 --- a/gcc/hsa-gen.c +++ b/gcc/hsa-gen.c @@ -1959,8 +1959,8 @@ gen_hsa_addr (tree ref, hsa_bb *hbb, HOST_WIDE_INT *output_bitsize = NULL, goto out; } else if (TREE_CODE (ref) == BIT_FIELD_REF - && ((tree_to_uhwi (TREE_OPERAND (ref, 1)) % BITS_PER_UNIT) != 0 - || (tree_to_uhwi (TREE_OPERAND (ref, 2)) % BITS_PER_UNIT) != 0)) + && (!multiple_p (bit_field_size (ref), BITS_PER_UNIT) + || !multiple_p (bit_field_offset (ref), BITS_PER_UNIT))) { HSA_SORRY_ATV (EXPR_LOCATION (origref), "support for HSA does not implement " |