From 4998268292c6b27cdd51e180ac0780f1dfaa0b08 Mon Sep 17 00:00:00 2001 From: John Wehle Date: Fri, 18 Aug 2000 02:41:58 +0000 Subject: [PATCH] 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 --- gcc/ChangeLog | 8 ++++++++ gcc/alias.c | 22 ++++++++++++++++++++-- gcc/rtl.h | 7 ++++--- 3 files changed, 32 insertions(+), 5 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b6639d1b459..e7705dc9c93 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +Thu Aug 17 22:40:05 EDT 2000 John Wehle (john@feith.com) + + * 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. + 2000-08-17 Rodney Brown * cse.c (insert_regs): Remove unused `regno'. diff --git a/gcc/alias.c b/gcc/alias.c index f879da39a51..ae8663845ab 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)); diff --git a/gcc/rtl.h b/gcc/rtl.h index 3802f25fe4c..a882cf6f4fe 100644 --- a/gcc/rtl.h +++ b/gcc/rtl.h @@ -116,9 +116,10 @@ typedef struct rtx_def /* 1 in an INSN if it can call another function. LINK_COST_FREE in an INSN_LIST. */ unsigned int call : 1; - /* 1 in a MEM or REG if value of this expression will never change - during the current function, even though it is not - manifestly constant. + /* 1 in a REG if value of this expression will never change during + the current function, even though it is not manifestly constant. + 1 in a MEM if contents of memory are constant. This does not + necessarily mean that the value of this expression is constant. 1 in a SUBREG if it is from a promoted variable that is unsigned. 1 in a SYMBOL_REF if it addresses something in the per-function constants pool. -- 2.30.2