diff options
author | Bernd Schmidt <bernds@codesourcery.com> | 2010-06-29 13:51:37 +0000 |
---|---|---|
committer | Bernd Schmidt <bernds@gcc.gnu.org> | 2010-06-29 13:51:37 +0000 |
commit | 3df41baf91c488fb02905562aef28d6ccfa6146a (patch) | |
tree | 6f4891ddd4a72cde06b176e32e7c65dcb748eeaf /gcc/cse.c | |
parent | 810c4bf4f02f33cc69d7af5d8c2eeddadd1c380b (diff) | |
download | gcc-3df41baf91c488fb02905562aef28d6ccfa6146a.zip gcc-3df41baf91c488fb02905562aef28d6ccfa6146a.tar.gz gcc-3df41baf91c488fb02905562aef28d6ccfa6146a.tar.bz2 |
Revert parts of the change for PR25130.
* cse.c (exp_equiv_p): For MEMs, if for_gcse, only compare
MEM_ALIAS_SET.
From-SVN: r161534
Diffstat (limited to 'gcc/cse.c')
-rw-r--r-- | gcc/cse.c | 22 |
1 files changed, 6 insertions, 16 deletions
@@ -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; |