aboutsummaryrefslogtreecommitdiff
path: root/gcc/alias.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2009-04-24 08:58:02 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2009-04-24 08:58:02 +0200
commit6216f94e37db8de5a846c5945f4aa5f4e32aaedf (patch)
treeb915c002276568ad8d30cd5e3340544d674fc103 /gcc/alias.c
parent6de7a512f0e76268d8ff69e51be80527c58d854b (diff)
downloadgcc-6216f94e37db8de5a846c5945f4aa5f4e32aaedf.zip
gcc-6216f94e37db8de5a846c5945f4aa5f4e32aaedf.tar.gz
gcc-6216f94e37db8de5a846c5945f4aa5f4e32aaedf.tar.bz2
re PR rtl-optimization/39794 (Miscompile with -O2 -funroll-loops)
PR rtl-optimization/39794 * alias.c (canon_true_dependence): Add x_addr argument. * rtl.h (canon_true_dependence): Adjust prototype. * cse.c (check_dependence): Adjust canon_true_dependence callers. * cselib.c (cselib_invalidate_mem): Likewise. * gcse.c (compute_transp): Likewise. * dse.c (scan_reads_nospill): Likewise. (record_store, check_mem_read_rtx): Likewise. For non-const-or-frame addresses pass base->val_rtx as mem_addr, for const-or-frame addresses canon_base_addr of the group, plus optional offset. (struct group_info): Rename canon_base_mem to canon_base_addr. (get_group_info): Set canon_base_addr to canon_rtx of base, not canon_rtx of base_mem. * gcc.dg/pr39794.c: New test. From-SVN: r146669
Diffstat (limited to 'gcc/alias.c')
-rw-r--r--gcc/alias.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/gcc/alias.c b/gcc/alias.c
index acfd934..8a20f46 100644
--- a/gcc/alias.c
+++ b/gcc/alias.c
@@ -2287,14 +2287,13 @@ true_dependence (const_rtx mem, enum machine_mode mem_mode, const_rtx x,
Variant of true_dependence which assumes MEM has already been
canonicalized (hence we no longer do that here).
The mem_addr argument has been added, since true_dependence computed
- this value prior to canonicalizing. */
+ this value prior to canonicalizing.
+ If x_addr is non-NULL, it is used in preference of XEXP (x, 0). */
int
canon_true_dependence (const_rtx mem, enum machine_mode mem_mode, rtx mem_addr,
- const_rtx x, bool (*varies) (const_rtx, bool))
+ const_rtx x, rtx x_addr, bool (*varies) (const_rtx, bool))
{
- rtx x_addr;
-
if (MEM_VOLATILE_P (x) && MEM_VOLATILE_P (mem))
return 1;
@@ -2320,7 +2319,8 @@ canon_true_dependence (const_rtx mem, enum machine_mode mem_mode, rtx mem_addr,
if (nonoverlapping_memrefs_p (x, mem))
return 0;
- x_addr = get_addr (XEXP (x, 0));
+ if (! x_addr)
+ x_addr = get_addr (XEXP (x, 0));
if (! base_alias_check (x_addr, mem_addr, GET_MODE (x), mem_mode))
return 0;