===================================================================
@@ -1967,7 +1967,7 @@ struct symbolic_number {
tree type;
tree base_addr;
tree offset;
- HOST_WIDE_INT bytepos;
+ poly_int64 bytepos;
tree src;
tree alias_set;
tree vuse;
@@ -2198,7 +2198,7 @@ perform_symbolic_merge (gimple *source_s
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;
@@ -2210,15 +2210,19 @@ perform_symbolic_merge (gimple *source_s
|| (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);
@@ -2230,8 +2234,8 @@ perform_symbolic_merge (gimple *source_s
/* 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;
@@ -2250,7 +2254,7 @@ perform_symbolic_merge (gimple *source_s
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. */