diff options
author | Richard Kenner <kenner@vlsi1.ultra.nyu.edu> | 2001-11-11 10:51:17 +0000 |
---|---|---|
committer | Richard Kenner <kenner@gcc.gnu.org> | 2001-11-11 05:51:17 -0500 |
commit | d746694a4593b1401b9638d605f59083d488af1e (patch) | |
tree | f0cb79d87d3ffba6c6d96bd6fdd04a7c440ba780 /gcc/alias.c | |
parent | 6f38bb171dc664170c69b2ebb8a54796adde92a1 (diff) | |
download | gcc-d746694a4593b1401b9638d605f59083d488af1e.tar.gz |
alias.c (nonoverlapping_memrefs_p): Not overlapping if one base is constant and one is on frame.
* alias.c (nonoverlapping_memrefs_p): Not overlapping if one base is
constant and one is on frame.
If know memref offset, adjust size from decl.
From-SVN: r46925
Diffstat (limited to 'gcc/alias.c')
-rw-r--r-- | gcc/alias.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/gcc/alias.c b/gcc/alias.c index add9c94bb48..2e03a068a55 100644 --- a/gcc/alias.c +++ b/gcc/alias.c @@ -1798,13 +1798,16 @@ nonoverlapping_memrefs_p (x, y) if (GET_CODE (basey) == PLUS && GET_CODE (XEXP (basey, 1)) == CONST_INT) offsety = INTVAL (XEXP (basey, 1)), basey = XEXP (basey, 0); - /* If the bases are both constant and they are different, we know these - do not overlap. If they are both registers, we can only deduce - something if they are the same register. */ - if (CONSTANT_P (basex) && CONSTANT_P (basey) && ! rtx_equal_p (basex, basey)) - return 1; - else if (! rtx_equal_p (basex, basey)) - return 0; + /* If the bases are different, we know they do not overlap if both + are constants or if one is a constant and the other a pointer into the + stack frame. Otherwise a different base means we can't tell if they + overlap or not. */ + if (! rtx_equal_p (basex, basey)) + return ((CONSTANT_P (basex) && CONSTANT_P (basey)) + || (CONSTANT_P (basex) && REG_P (basey) + && REGNO (basey) <= LAST_VIRTUAL_REGISTER) + || (CONSTANT_P (basey) && REG_P (basex) + && REGNO (basex) <= LAST_VIRTUAL_REGISTER)); sizex = (REG_P (rtlx) ? GET_MODE_SIZE (GET_MODE (rtlx)) : MEM_SIZE (rtlx) ? INTVAL (MEM_SIZE (rtlx)) @@ -1816,9 +1819,9 @@ nonoverlapping_memrefs_p (x, y) /* If we have an offset or size for either memref, it can update the values computed above. */ if (MEM_OFFSET (x)) - offsetx += INTVAL (MEM_OFFSET (x)); + offsetx += INTVAL (MEM_OFFSET (x)), sizex -= INTVAL (MEM_OFFSET (x)); if (MEM_OFFSET (y)) - offsety += INTVAL (MEM_OFFSET (y)); + offsety += INTVAL (MEM_OFFSET (y)), sizey -= INTVAL (MEM_OFFSET (y)); if (MEM_SIZE (x)) sizex = INTVAL (MEM_SIZE (x)); |