Fix bug in alias.c:nonoverlapping_memref_p

Richard Kenner kenner@vlsi1.ultra.nyu.edu
Fri Nov 2 13:53:00 GMT 2001


Installed as obvious:

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.

*** alias.c	2001/11/12 10:15:03	1.154
--- alias.c	2001/11/12 16:46:28
*************** nonoverlapping_memrefs_p (x, y)
*** 1818,1823 ****
  	   -1);
  
!   /* 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)), sizex -= INTVAL (MEM_OFFSET (x));
--- 1818,1823 ----
  	   -1);
  
!   /* 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));
*************** nonoverlapping_memrefs_p (x, y)
*** 1825,1831 ****
      offsety += INTVAL (MEM_OFFSET (y)), sizey -= INTVAL (MEM_OFFSET (y));
  
!   if (MEM_SIZE (x))
      sizex = INTVAL (MEM_SIZE (x));
!   if (MEM_SIZE (y))
      sizey = INTVAL (MEM_SIZE (y));
  
--- 1825,1834 ----
      offsety += INTVAL (MEM_OFFSET (y)), sizey -= INTVAL (MEM_OFFSET (y));
  
!   /* 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) && MEM_OFFSET (y))
      sizey = INTVAL (MEM_SIZE (y));
  



More information about the Gcc-patches mailing list