Handle variable-sized vectors for BIT_FIELD_REF canonicalization.
gcc/ChangeLog:
* gimple-fold.cc (maybe_canonicalize_mem_ref_addr): Handle variable
sized vector types in BIT_FIELD_REF canonicalization.
* tree-cfg.cc (verify_types_in_gimple_reference): Change object-size-
checking for BIT_FIELD_REF to error offsets that are known_gt to be
outside object-size. Out-of-range offsets can happen in the case of
indices that reference VLA SVE vector elements that may be outside the
minimum vector size range and therefore maybe_gt is not appropirate
here.
(TYPE_SIZE (TREE_TYPE (*t))));
widest_int ext
= wi::add (idx, wi::to_widest (TYPE_SIZE (TREE_TYPE (*t))));
- if (wi::les_p (ext, wi::to_widest (TYPE_SIZE (vtype))))
+ if (maybe_le (ext, wi::to_poly_widest (TYPE_SIZE (vtype))))
{
*t = build3_loc (EXPR_LOCATION (*t), BIT_FIELD_REF,
TREE_TYPE (*t),
return true;
}
if (!AGGREGATE_TYPE_P (TREE_TYPE (op))
- && maybe_gt (size + bitpos,
+ && known_gt (size + bitpos,
tree_to_poly_uint64 (TYPE_SIZE (TREE_TYPE (op)))))
{
error ("position plus size exceeds size of referenced object in "