aboutsummaryrefslogtreecommitdiff
path: root/gcc/alias.c
diff options
context:
space:
mode:
authorJohn Wehle <john@feith.com>2000-08-25 16:52:24 +0000
committerJohn Wehle <wehle@gcc.gnu.org>2000-08-25 16:52:24 +0000
commitb949ea8b0f724013ec018b7af86ba134a229d723 (patch)
tree1f4cb865a07357d51f3f12cc3e78156fa5a0c581 /gcc/alias.c
parent343b7260c6f4c4164fd65368a7d2391defcbd098 (diff)
downloadgcc-b949ea8b0f724013ec018b7af86ba134a229d723.zip
gcc-b949ea8b0f724013ec018b7af86ba134a229d723.tar.gz
gcc-b949ea8b0f724013ec018b7af86ba134a229d723.tar.bz2
i386.c (ix86_find_base_term): New.
* i386.c (ix86_find_base_term): New. * i386-protos.h (ix86_find_base_term): Prototype. * i386.h (FIND_BASE_TERM): Define. * alias.c (find_base_term): Use it. * tm.texi (FIND_BASE_TERM): Document it. * alias.c (true_dependence, write_dependence_p): Unchanging memory can't conflict with non-unchanging memory. * alias.c (memrefs_conflict_p): A BLKmode reference to a symbol (or CONST_INT address) always conflicts with a reference to another symbol. From-SVN: r35985
Diffstat (limited to 'gcc/alias.c')
-rw-r--r--gcc/alias.c33
1 files changed, 22 insertions, 11 deletions
diff --git a/gcc/alias.c b/gcc/alias.c
index 5d96dad..cb5a636 100644
--- a/gcc/alias.c
+++ b/gcc/alias.c
@@ -1033,6 +1033,11 @@ find_base_term (x)
cselib_val *val;
struct elt_loc_list *l;
+#if defined (FIND_BASE_TERM)
+ /* Try machine-dependent ways to find the base term. */
+ x = FIND_BASE_TERM (x);
+#endif
+
switch (GET_CODE (x))
{
case REG:
@@ -1078,6 +1083,9 @@ find_base_term (x)
is a shift or multiply, then it must be the index register and the
other operand is the base register. */
+ if (tmp1 == pic_offset_table_rtx && CONSTANT_P (tmp2))
+ return find_base_term (tmp2);
+
/* If either operand is known to be a pointer, then use it
to determine the base term. */
if (REG_P (tmp1) && REGNO_POINTER_FLAG (REGNO (tmp1)))
@@ -1469,10 +1477,9 @@ memrefs_conflict_p (xsize, x, ysize, y, c)
canon_rtx (XEXP (y, 0)), c);
if (CONSTANT_P (y))
- return (xsize < 0 || ysize < 0
+ return (xsize <= 0 || ysize <= 0
|| (rtx_equal_for_memref_p (x, y)
- && (xsize == 0 || ysize == 0
- || (c >= 0 && xsize > c) || (c < 0 && ysize+c > 0))));
+ && ((c >= 0 && xsize > c) || (c < 0 && ysize+c > 0))));
return 1;
}
@@ -1574,14 +1581,14 @@ true_dependence (mem, mem_mode, x, varies)
if (DIFFERENT_ALIAS_SETS_P (x, mem))
return 0;
- /* If X is an unchanging read, then it can't possibly conflict with any
- non-unchanging store. It may conflict with an unchanging write though,
- because there may be a single store to this address to initialize it.
- Just fall through to the code below to resolve the case where we have
- both an unchanging read and an unchanging write. This won't handle all
- cases optimally, but the possible performance loss should be
- negligible. */
- if (RTX_UNCHANGING_P (x) && ! RTX_UNCHANGING_P (mem))
+ /* Unchanging memory can't conflict with non-unchanging memory.
+ A non-unchanging read can conflict with a non-unchanging write.
+ An unchanging read can conflict with an unchanging write since
+ there may be a single store to this address to initialize it.
+ Just fall through to the code below to resolve potential conflicts.
+ This won't handle all cases optimally, but the possible performance
+ loss should be negligible. */
+ if (RTX_UNCHANGING_P (x) != RTX_UNCHANGING_P (mem))
return 0;
if (mem_mode == VOIDmode)
@@ -1642,6 +1649,10 @@ write_dependence_p (mem, x, writep)
if (DIFFERENT_ALIAS_SETS_P (x, mem))
return 0;
+ /* Unchanging memory can't conflict with non-unchanging memory. */
+ if (RTX_UNCHANGING_P (x) != RTX_UNCHANGING_P (mem))
+ return 0;
+
/* If MEM is an unchanging read, then it can't possibly conflict with
the store to X, because there is at most one store to MEM, and it must
have occurred somewhere before MEM. */