aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJim Wilson <wilson@cygnus.com>1997-09-03 19:28:49 +0000
committerJim Wilson <wilson@gcc.gnu.org>1997-09-03 12:28:49 -0700
commitfa8b60246437510ca70a89f5d9a127849f4228e5 (patch)
tree6f784566b8cf913929bf3bb2e772812c549daac1 /gcc
parent03e707055891d5eaaf5dc9e850123bd2dd16ba38 (diff)
downloadgcc-fa8b60246437510ca70a89f5d9a127849f4228e5.zip
gcc-fa8b60246437510ca70a89f5d9a127849f4228e5.tar.gz
gcc-fa8b60246437510ca70a89f5d9a127849f4228e5.tar.bz2
Fix H.J. Lu's alpha-linux aliasing bug.
* alias.c (true_dependence): Address with AND can alias scalars. (anti_dependence, output_dependence): Likewise. From-SVN: r15063
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog3
-rw-r--r--gcc/alias.c12
2 files changed, 13 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 190eb48..e77c1c6 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,8 @@
Wed Sep 3 10:39:42 1997 Jim Wilson <wilson@cygnus.com>
+ * alias.c (true_dependence): Address with AND can alias scalars.
+ (anti_dependence, output_dependence): Likewise.
+
* alias.c (true_dependence): Test x for BLKmode, in addition to mem.
Wed Sep 3 09:28:50 CDT 1997 Joel Sherrill (joel@OARcorp.com)
diff --git a/gcc/alias.c b/gcc/alias.c
index cb3a917..4c2ca48 100644
--- a/gcc/alias.c
+++ b/gcc/alias.c
@@ -751,11 +751,14 @@ memrefs_conflict_p (xsize, x, ysize, y, c)
changed. A volatile and non-volatile reference can be interchanged
though.
- A MEM_IN_STRUCT reference at a non-QImode varying address can never
+ A MEM_IN_STRUCT reference at a non-QImode non-AND varying address can never
conflict with a non-MEM_IN_STRUCT reference at a fixed address. We must
allow QImode aliasing because the ANSI C standard allows character
pointers to alias anything. We are assuming that characters are
- always QImode here. */
+ always QImode here. We also must allow AND addresses, because they may
+ generate accesses outside the object being referenced. This is used to
+ generate aligned addresses from unaligned addresses, for instance, the
+ alpha storeqi_unaligned pattern. */
/* Read dependence: X is read after read in MEM takes place. There can
only be a dependence here if both reads are volatile. */
@@ -816,6 +819,7 @@ true_dependence (mem, mem_mode, x, varies)
if (MEM_IN_STRUCT_P (x) == MEM_IN_STRUCT_P (mem)
|| mem_mode == QImode || mem_mode == BLKmode
|| GET_MODE (x) == QImode || GET_MODE (x) == BLKmode
+ || GET_CODE (x_addr) == AND || GET_CODE (mem_addr) == AND
|| varies (x_addr) == varies (mem_addr))
return 1;
@@ -856,9 +860,11 @@ anti_dependence (mem, x)
SIZE_FOR_MODE (x), XEXP (x, 0), 0)
&& ! (MEM_IN_STRUCT_P (mem) && rtx_addr_varies_p (mem)
&& GET_MODE (mem) != QImode
+ && GET_CODE (XEXP (mem, 0)) != AND
&& ! MEM_IN_STRUCT_P (x) && ! rtx_addr_varies_p (x))
&& ! (MEM_IN_STRUCT_P (x) && rtx_addr_varies_p (x)
&& GET_MODE (x) != QImode
+ && GET_CODE (XEXP (x, 0)) != AND
&& ! MEM_IN_STRUCT_P (mem) && ! rtx_addr_varies_p (mem)));
}
@@ -881,9 +887,11 @@ output_dependence (mem, x)
SIZE_FOR_MODE (x), XEXP (x, 0), 0)
&& ! (MEM_IN_STRUCT_P (mem) && rtx_addr_varies_p (mem)
&& GET_MODE (mem) != QImode
+ && GET_CODE (XEXP (mem, 0)) != AND
&& ! MEM_IN_STRUCT_P (x) && ! rtx_addr_varies_p (x))
&& ! (MEM_IN_STRUCT_P (x) && rtx_addr_varies_p (x)
&& GET_MODE (x) != QImode
+ && GET_CODE (XEXP (x, 0)) != AND
&& ! MEM_IN_STRUCT_P (mem) && ! rtx_addr_varies_p (mem)));
}