OSDN Git Service

Revert parts of the change for PR25130.
authorbernds <bernds@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 29 Jun 2010 13:51:37 +0000 (13:51 +0000)
committerbernds <bernds@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 29 Jun 2010 13:51:37 +0000 (13:51 +0000)
* cse.c (exp_equiv_p): For MEMs, if for_gcse, only compare
MEM_ALIAS_SET.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@161534 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/cse.c

index 059542a..8beace5 100644 (file)
@@ -5,6 +5,10 @@
        (maddhisi4): Renamed from mulhisi3addsi.  Operands renumbered.
        (maddhidi4): Likewise.
 
+       Revert parts of the change for PR25130.
+       * cse.c (exp_equiv_p): For MEMs, if for_gcse, only compare
+       MEM_ALIAS_SET.
+
 2010-06-29  Nathan Froyd  <froydnj@codesourcery.com>
 
        * calls.c, dse.c, expr.c, function.c: Call targetm.calls.function_arg,
index 43072b3..82921f6 100644 (file)
--- 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;