+2017-12-20 Richard Sandiford <richard.sandiford@linaro.org>
+ Alan Hayward <alan.hayward@arm.com>
+ David Sherwood <david.sherwood@arm.com>
+
+ * gimple-ssa-store-merging.c (symbolic_number::bytepos): Change from
+ HOST_WIDE_INT to poly_int64_pod.
+ (perform_symbolic_merge): Update accordingly.
+ (bswap_replace): Likewise.
+
2017-12-20 Richard Sandiford <richard.sandiford@linaro.org>
Alan Hayward <alan.hayward@arm.com>
David Sherwood <david.sherwood@arm.com>
tree type;
tree base_addr;
tree offset;
- HOST_WIDE_INT bytepos;
+ poly_int64_pod bytepos;
tree src;
tree alias_set;
tree vuse;
if (rhs1 != rhs2)
{
uint64_t inc;
- HOST_WIDE_INT start_sub, end_sub, end1, end2, end;
+ HOST_WIDE_INT start1, start2, start_sub, end_sub, end1, end2, end;
struct symbolic_number *toinc_n_ptr, *n_end;
basic_block bb1, bb2;
|| (n1->offset && !operand_equal_p (n1->offset, n2->offset, 0)))
return NULL;
- if (n1->bytepos < n2->bytepos)
+ start1 = 0;
+ if (!(n2->bytepos - n1->bytepos).is_constant (&start2))
+ return NULL;
+
+ if (start1 < start2)
{
n_start = n1;
- start_sub = n2->bytepos - n1->bytepos;
+ start_sub = start2 - start1;
}
else
{
n_start = n2;
- start_sub = n1->bytepos - n2->bytepos;
+ start_sub = start1 - start2;
}
bb1 = gimple_bb (source_stmt1);
/* Find the highest address at which a load is performed and
compute related info. */
- end1 = n1->bytepos + (n1->range - 1);
- end2 = n2->bytepos + (n2->range - 1);
+ end1 = start1 + (n1->range - 1);
+ end2 = start2 + (n2->range - 1);
if (end1 < end2)
{
end = end2;
else
toinc_n_ptr = (n_start == n1) ? n2 : n1;
- n->range = end - n_start->bytepos + 1;
+ n->range = end - MIN (start1, start2) + 1;
/* Check that the range of memory covered can be represented by
a symbolic number. */
tree load_offset_ptr, aligned_load_type;
gimple *load_stmt;
unsigned align = get_object_alignment (src);
- HOST_WIDE_INT load_offset = 0;
+ poly_int64 load_offset = 0;
if (cur_stmt)
{