alias.c (nonoverlapping_memrefs_p): Only update size from memref if both size and...
authorRichard Kenner <kenner@vlsi1.ultra.nyu.edu>
Mon, 12 Nov 2001 16:56:48 +0000 (16:56 +0000)
committerRichard Kenner <kenner@gcc.gnu.org>
Mon, 12 Nov 2001 16:56:48 +0000 (11:56 -0500)
* alias.c (nonoverlapping_memrefs_p): Only update size from memref
if both size and offset known.

From-SVN: r46956

gcc/ChangeLog
gcc/alias.c

index 017042e59452d8387547ae2807b2477db0bd8831..9963c167fea4a1ac50a8104ed950d228cd69c8d9 100644 (file)
@@ -1,3 +1,8 @@
+Mon Nov 12 11:58:26 2001  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
+
+       * alias.c (nonoverlapping_memrefs_p): Only update size from memref
+       if both size and offset known.
+
 2001-11-12  David O'Brien  <obrien@FreeBSD.org>
 
        * config/ia64/freebsd.h: Fix misspelling.
index 45e82643ad7bacd7ce0c5795b797fd81ba1b76ef..7f01c0c73961907c3621c374ac6c8dae0af95243 100644 (file)
@@ -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.  */