aboutsummaryrefslogtreecommitdiff
path: root/gcc/alias.c
diff options
context:
space:
mode:
authorRichard Kenner <kenner@vlsi1.ultra.nyu.edu>2001-11-12 16:56:48 +0000
committerRichard Kenner <kenner@gcc.gnu.org>2001-11-12 11:56:48 -0500
commit0af5bc3eae6d6cc0bd0e40c5d770f0f4cd083b47 (patch)
tree1fa2e5dfd7a4057fe7848ae8d3cb6995e75158b1 /gcc/alias.c
parent834a28c7a8dae51fa89e95bbfe5b0bfa62806401 (diff)
downloadgcc-0af5bc3eae6d6cc0bd0e40c5d770f0f4cd083b47.zip
gcc-0af5bc3eae6d6cc0bd0e40c5d770f0f4cd083b47.tar.gz
gcc-0af5bc3eae6d6cc0bd0e40c5d770f0f4cd083b47.tar.bz2
alias.c (nonoverlapping_memrefs_p): Only update size from memref if both size and offset known.
* alias.c (nonoverlapping_memrefs_p): Only update size from memref if both size and offset known. From-SVN: r46956
Diffstat (limited to 'gcc/alias.c')
-rw-r--r--gcc/alias.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/gcc/alias.c b/gcc/alias.c
index 45e8264..7f01c0c 100644
--- a/gcc/alias.c
+++ b/gcc/alias.c
@@ -1817,16 +1817,19 @@ nonoverlapping_memrefs_p (x, y)
: MEM_SIZE (rtly) ? INTVAL (MEM_SIZE (rtly)) :
-1);
- /* If we have an offset or size for either memref, it can update the values
- computed above. */
+ /* If we have an offset for either memref, it can update the values computed
+ above. */
if (MEM_OFFSET (x))
offsetx += INTVAL (MEM_OFFSET (x)), sizex -= INTVAL (MEM_OFFSET (x));
if (MEM_OFFSET (y))
offsety += INTVAL (MEM_OFFSET (y)), sizey -= INTVAL (MEM_OFFSET (y));
- if (MEM_SIZE (x))
+ /* If a memref has both a size and an offset, we can use the smaller size.
+ We can't do this is the offset isn't know because we must view this
+ memref as being anywhere inside the DECL's MEM. */
+ if (MEM_SIZE (x) && MEM_OFFSET (x))
sizex = INTVAL (MEM_SIZE (x));
- if (MEM_SIZE (y))
+ if (MEM_SIZE (y) && MEM_OFFSET (y))
sizey = INTVAL (MEM_SIZE (y));
/* Put the values of the memref with the lower offset in X's values. */