2017-11-29 Jakub Jelinek <jakub@redhat.com>
+ PR middle-end/83185
+ * tree.c (build_simple_mem_ref_loc): Handle
+ get_addr_base_and_unit_offset returning a MEM_REF.
+
PR middle-end/80929
* rtlanal.c (seq_cost): For non-single_set insns try to use insn_cost.
2017-11-29 Jakub Jelinek <jakub@redhat.com>
+ PR middle-end/83185
+ * gcc.dg/asan/pr83185.c: New test.
+
PR target/80819
* gcc.target/i386/pr80819-1.c: New test.
* gcc.target/i386/pr80819-2.c: New test.
{
ptr = get_addr_base_and_unit_offset (TREE_OPERAND (ptr, 0), &offset);
gcc_assert (ptr);
- ptr = build_fold_addr_expr (ptr);
+ if (TREE_CODE (ptr) == MEM_REF)
+ {
+ offset += mem_ref_offset (ptr).to_short_addr ();
+ ptr = TREE_OPERAND (ptr, 0);
+ }
+ else
+ ptr = build_fold_addr_expr (ptr);
gcc_assert (is_gimple_reg (ptr) || is_gimple_min_invariant (ptr));
}
tem = build2 (MEM_REF, TREE_TYPE (ptype),