aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/alias.c21
2 files changed, 18 insertions, 9 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index e2782cb..00e4736 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+Sun Nov 11 05:56:01 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
+
+ * 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.
+
2001-11-11 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* alpha/unicosmk.h (ASM_OUTPUT_DOUBLE, ASM_OUTPUT_FLOAT): Fix
diff --git a/gcc/alias.c b/gcc/alias.c
index add9c94..2e03a06 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));