+2018-02-16 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/84417
+ * tree-ssa.c (non_rewritable_mem_ref_base): Properly constrain
+ the MEM_REF offset when conversion to BIT_FIELD_REF is desired.
+ (non_rewritable_lvalue_p): Likewise, use poly-ints.
+
2018-02-16 Martin Liska <mliska@suse.cz>
PR sanitizer/84307
|| TREE_CODE (TREE_TYPE (decl)) == COMPLEX_TYPE)
&& useless_type_conversion_p (TREE_TYPE (base),
TREE_TYPE (TREE_TYPE (decl)))
+ && known_ge (mem_ref_offset (base), 0)
&& known_gt (wi::to_poly_offset (TYPE_SIZE_UNIT (TREE_TYPE (decl))),
mem_ref_offset (base))
&& multiple_of_p (sizetype, TREE_OPERAND (base, 1),
&& TYPE_MODE (TREE_TYPE (decl)) != BLKmode
&& operand_equal_p (TYPE_SIZE_UNIT (TREE_TYPE (lhs)),
TYPE_SIZE_UNIT (TREE_TYPE (TREE_TYPE (decl))), 0)
- && tree_fits_uhwi_p (TREE_OPERAND (lhs, 1))
- && tree_int_cst_lt (TREE_OPERAND (lhs, 1),
- TYPE_SIZE_UNIT (TREE_TYPE (decl)))
- && (tree_to_uhwi (TREE_OPERAND (lhs, 1))
- % tree_to_uhwi (TYPE_SIZE_UNIT (TREE_TYPE (lhs)))) == 0)
+ && known_ge (mem_ref_offset (lhs), 0)
+ && known_gt (wi::to_poly_offset (TYPE_SIZE_UNIT (TREE_TYPE (decl))),
+ mem_ref_offset (lhs))
+ && multiple_of_p (sizetype, TREE_OPERAND (lhs, 1),
+ TYPE_SIZE_UNIT (TREE_TYPE (lhs))))
return false;
}