summaryrefslogtreecommitdiff
path: root/gcc/alias.c
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2010-04-16 09:26:43 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2010-04-16 09:26:43 +0000
commit6f9688ce13fbcb6e20676cf821b3824f8d052a0b (patch)
tree1728270296344efa111f7dd12bbe6946f34b601b /gcc/alias.c
parentc9c28109de6ec319c6c675ed25d9c61aacb41c50 (diff)
downloadgcc-6f9688ce13fbcb6e20676cf821b3824f8d052a0b.tar.gz
* alias.c (memrefs_conflict_p): If x and y are the same VALUE,
don't call get_addr on both. If one expression is a VALUE and the other a REG, check VALUE's locs if the REG isn't among them. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158401 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/alias.c')
-rw-r--r--gcc/alias.c34
1 files changed, 32 insertions, 2 deletions
diff --git a/gcc/alias.c b/gcc/alias.c
index 4be708561ef..6ec51ec2967 100644
--- a/gcc/alias.c
+++ b/gcc/alias.c
@@ -1789,9 +1789,39 @@ static int
memrefs_conflict_p (int xsize, rtx x, int ysize, rtx y, HOST_WIDE_INT c)
{
if (GET_CODE (x) == VALUE)
- x = get_addr (x);
+ {
+ if (REG_P (y))
+ {
+ struct elt_loc_list *l;
+ for (l = CSELIB_VAL_PTR (x)->locs; l; l = l->next)
+ if (REG_P (l->loc) && rtx_equal_for_memref_p (l->loc, y))
+ break;
+ if (l)
+ x = y;
+ else
+ x = get_addr (x);
+ }
+ /* Don't call get_addr if y is the same VALUE. */
+ else if (x != y)
+ x = get_addr (x);
+ }
if (GET_CODE (y) == VALUE)
- y = get_addr (y);
+ {
+ if (REG_P (x))
+ {
+ struct elt_loc_list *l;
+ for (l = CSELIB_VAL_PTR (y)->locs; l; l = l->next)
+ if (REG_P (l->loc) && rtx_equal_for_memref_p (l->loc, x))
+ break;
+ if (l)
+ y = x;
+ else
+ y = get_addr (y);
+ }
+ /* Don't call get_addr if x is the same VALUE. */
+ else if (y != x)
+ y = get_addr (y);
+ }
if (GET_CODE (x) == HIGH)
x = XEXP (x, 0);
else if (GET_CODE (x) == LO_SUM)