aboutsummaryrefslogtreecommitdiff
path: root/gcc/cse.c
diff options
context:
space:
mode:
authorBernd Schmidt <bernds@codesourcery.com>2010-06-29 13:51:37 +0000
committerBernd Schmidt <bernds@codesourcery.com>2010-06-29 13:51:37 +0000
commit2db5fbcdab3cedfe388523ee30e566a8e3b1ef49 (patch)
tree6f4891ddd4a72cde06b176e32e7c65dcb748eeaf /gcc/cse.c
parent28a022725cdf35b57ed5ae759a99003e315ae376 (diff)
Revert parts of the change for PR25130.
* cse.c (exp_equiv_p): For MEMs, if for_gcse, only compare MEM_ALIAS_SET. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@161534 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cse.c')
-rw-r--r--gcc/cse.c22
1 files changed, 6 insertions, 16 deletions
diff --git a/gcc/cse.c b/gcc/cse.c
index 43072b34012..82921f66861 100644
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -2669,26 +2669,16 @@ exp_equiv_p (const_rtx x, const_rtx y, int validate, bool for_gcse)
case MEM:
if (for_gcse)
{
+ /* Can't merge two expressions in different alias sets, since we
+ can decide that the expression is transparent in a block when
+ it isn't, due to it being set with the different alias set. */
+ if (MEM_ALIAS_SET (x) != MEM_ALIAS_SET (y))
+ return 0;
+
/* A volatile mem should not be considered equivalent to any
other. */
if (MEM_VOLATILE_P (x) || MEM_VOLATILE_P (y))
return 0;
-
- /* Can't merge two expressions in different alias sets, since we
- can decide that the expression is transparent in a block when
- it isn't, due to it being set with the different alias set.
-
- Also, can't merge two expressions with different MEM_ATTRS.
- They could e.g. be two different entities allocated into the
- same space on the stack (see e.g. PR25130). In that case, the
- MEM addresses can be the same, even though the two MEMs are
- absolutely not equivalent.
-
- But because really all MEM attributes should be the same for
- equivalent MEMs, we just use the invariant that MEMs that have
- the same attributes share the same mem_attrs data structure. */
- if (MEM_ATTRS (x) != MEM_ATTRS (y))
- return 0;
}
break;