tree-ssa-alias.c (indirect_refs_may_alias_p): Fix TARGET_MEM_REF handling.
authorRichard Guenther <rguenther@suse.de>
Wed, 27 Apr 2011 09:17:01 +0000 (09:17 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Wed, 27 Apr 2011 09:17:01 +0000 (09:17 +0000)
2011-04-27  Richard Guenther  <rguenther@suse.de>

* tree-ssa-alias.c (indirect_refs_may_alias_p): Fix
TARGET_MEM_REF handling.

From-SVN: r173018

gcc/ChangeLog
gcc/tree-ssa-alias.c

index 0ca77fba661ea0622f09a40bb49461f83a55cf81..492a92dad53fceab1dea08d58b78cc5f510a6077 100644 (file)
@@ -1,3 +1,8 @@
+2011-04-27  Richard Guenther  <rguenther@suse.de>
+
+       * tree-ssa-alias.c (indirect_refs_may_alias_p): Fix
+       TARGET_MEM_REF handling.
+
 2011-04-27  Nick Clifton  <nickc@redhat.com>
 
        * config/frv/frv.h (enum reg_class): Delete EVEN_ACC_REGS,
index f324099b2360d4e82f9490477d6a57837d599399..315a252fadcee7a310b9a259d6f31cdac9451d3d 100644 (file)
@@ -925,12 +925,12 @@ indirect_refs_may_alias_p (tree ref1 ATTRIBUTE_UNUSED, tree base1,
   /* If both references are through the same type, they do not alias
      if the accesses do not overlap.  This does extra disambiguation
      for mixed/pointer accesses but requires strict aliasing.  */
-  if ((TREE_CODE (base1) != TARGET_MEM_REF || !TMR_INDEX (base1))
-      && (TREE_CODE (base2) != TARGET_MEM_REF || !TMR_INDEX (base2))
-      && (TREE_CODE (base1) != MEM_REF
-         || same_type_for_tbaa (TREE_TYPE (base1), TREE_TYPE (ptrtype1)) == 1)
-      && (TREE_CODE (base2) != MEM_REF
-         || same_type_for_tbaa (TREE_TYPE (base2), TREE_TYPE (ptrtype2)) == 1)
+  if ((TREE_CODE (base1) != TARGET_MEM_REF
+       || (!TMR_INDEX (base1) && !TMR_INDEX2 (base1)))
+      && (TREE_CODE (base2) != TARGET_MEM_REF
+         || (!TMR_INDEX (base2) && !TMR_INDEX2 (base2)))
+      && same_type_for_tbaa (TREE_TYPE (base1), TREE_TYPE (ptrtype1)) == 1
+      && same_type_for_tbaa (TREE_TYPE (base2), TREE_TYPE (ptrtype2)) == 1
       && same_type_for_tbaa (TREE_TYPE (ptrtype1),
                             TREE_TYPE (ptrtype2)) == 1)
     return ranges_overlap_p (offset1, max_size1, offset2, max_size2);
@@ -942,14 +942,9 @@ indirect_refs_may_alias_p (tree ref1 ATTRIBUTE_UNUSED, tree base1,
 
   /* Do access-path based disambiguation.  */
   if (ref1 && ref2
-      && handled_component_p (ref1)
-      && handled_component_p (ref2)
-      && TREE_CODE (base1) != TARGET_MEM_REF
-      && TREE_CODE (base2) != TARGET_MEM_REF
-      && (TREE_CODE (base1) != MEM_REF
-         || same_type_for_tbaa (TREE_TYPE (base1), TREE_TYPE (ptrtype1)) == 1)
-      && (TREE_CODE (base2) != MEM_REF
-         || same_type_for_tbaa (TREE_TYPE (base2), TREE_TYPE (ptrtype2)) == 1))
+      && (handled_component_p (ref1) || handled_component_p (ref2))
+      && same_type_for_tbaa (TREE_TYPE (base1), TREE_TYPE (ptrtype1)) == 1
+      && same_type_for_tbaa (TREE_TYPE (base2), TREE_TYPE (ptrtype2)) == 1)
     return aliasing_component_refs_p (ref1,
                                      ref1_alias_set, base1_alias_set,
                                      offset1, max_size1,