aboutsummaryrefslogtreecommitdiff
path: root/gcc/alias.c
diff options
context:
space:
mode:
authorJohn Wehle <john@feith.com>2000-08-18 02:41:58 +0000
committerJohn Wehle <wehle@gcc.gnu.org>2000-08-18 02:41:58 +0000
commit4998268292c6b27cdd51e180ac0780f1dfaa0b08 (patch)
treeaf730819a32f206d6a1042985debacae42c99c19 /gcc/alias.c
parent889e5964f263e0aa95663bebb10c176ee79d9402 (diff)
downloadgcc-4998268292c6b27cdd51e180ac0780f1dfaa0b08.zip
gcc-4998268292c6b27cdd51e180ac0780f1dfaa0b08.tar.gz
gcc-4998268292c6b27cdd51e180ac0780f1dfaa0b08.tar.bz2
alias.c (true_dependence, [...]): A read involving a label_ref or the constant pool doesn't create a dependency.
* alias.c (true_dependence, write_dependence_p): A read involving a label_ref or the constant pool doesn't create a dependency. * rtl.h (unchanging): Improve documentation. From-SVN: r35771
Diffstat (limited to 'gcc/alias.c')
-rw-r--r--gcc/alias.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/gcc/alias.c b/gcc/alias.c
index f879da3..ae86638 100644
--- a/gcc/alias.c
+++ b/gcc/alias.c
@@ -1566,6 +1566,7 @@ true_dependence (mem, mem_mode, x, varies)
int (*varies) PARAMS ((rtx));
{
register rtx x_addr, mem_addr;
+ rtx base;
if (MEM_VOLATILE_P (x) && MEM_VOLATILE_P (mem))
return 1;
@@ -1583,6 +1584,12 @@ true_dependence (mem, mem_mode, x, varies)
if (RTX_UNCHANGING_P (x) && ! RTX_UNCHANGING_P (mem))
return 0;
+ base = find_base_term (x);
+ if (base && (GET_CODE (base) == LABEL_REF
+ || (GET_CODE (base) == SYMBOL_REF
+ && CONSTANT_POOL_ADDRESS_P (base))))
+ return 0;
+
if (mem_mode == VOIDmode)
mem_mode = GET_MODE (mem);
@@ -1627,6 +1634,7 @@ write_dependence_p (mem, x, writep)
{
rtx x_addr, mem_addr;
rtx fixed_scalar;
+ rtx base;
if (MEM_VOLATILE_P (x) && MEM_VOLATILE_P (mem))
return 1;
@@ -1637,8 +1645,18 @@ write_dependence_p (mem, x, writep)
/* 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. */
- if (!writep && RTX_UNCHANGING_P (mem))
- return 0;
+ if (! writep)
+ {
+ if (RTX_UNCHANGING_P (mem))
+ return 0;
+
+ base = find_base_term (mem);
+ if (base && (GET_CODE (base) == LABEL_REF
+ || (GET_CODE (base) == SYMBOL_REF
+ && CONSTANT_POOL_ADDRESS_P (base))))
+ return 0;
+ }
+
x_addr = get_addr (XEXP (x, 0));
mem_addr = get_addr (XEXP (mem, 0));