if (rtx_equal_for_memref_p (x, y))
{
- if (xsize <= 0 || ysize <= 0)
+ if (xsize == 0 || ysize == 0)
return 1;
- if (c >= 0 && xsize > c)
+ if (c >= 0 && abs (xsize) - c > 0)
return 1;
- if (c < 0 && ysize+c > 0)
+ if (c < 0 && abs (ysize) + c > 0)
return 1;
return 0;
}
@@ -2063,7 +2063,8 @@ memrefs_conflict_p (int xsize, rtx x, int ysize, rtx y, HOST_WIDE_INT c)
y0 = canon_rtx (XEXP (y, 0));
if (rtx_equal_for_memref_p (x0, y0))
return (xsize == 0 || ysize == 0
- || (c >= 0 && xsize > c) || (c < 0 && ysize+c > 0));
+ || (c >= 0 && abs (xsize) - c > 0)
+ || (c < 0 && abs (ysize) + c > 0));
/* Can't properly adjust our sizes. */
if (!CONST_INT_P (x1))
@@ -2119,8 +2120,9 @@ memrefs_conflict_p (int xsize, rtx x, int ysize, rtx y, HOST_WIDE_INT c)
if (CONST_INT_P (x) && CONST_INT_P (y))
{
c += (INTVAL (y) - INTVAL (x));
- return (xsize <= 0 || ysize <= 0
- || (c >= 0 && xsize > c) || (c < 0 && ysize+c > 0));
+ return (xsize == 0 || ysize == 0
+ || (c >= 0 && abs (xsize) - c > 0)
+ || (c < 0 && abs (ysize) + c > 0));
}
if (GET_CODE (x) == CONST)
@@ -2139,7 +2141,8 @@ memrefs_conflict_p (int xsize, rtx x, int ysize, rtx y, HOST_WIDE_INT c)
if (CONSTANT_P (y))
return (xsize <= 0 || ysize <= 0
|| (rtx_equal_for_memref_p (x, y)
- && ((c >= 0 && xsize > c) || (c < 0 && ysize+c > 0))));
+ && ((c >= 0 && abs (xsize) - c > 0)
+ || (c < 0 && abs (ysize) + c > 0))));