tree-dfa.c (refs_may_alias_p): Allow all kinds of INDIRECT_REF and TARGET_MEM_REF.
authorRichard Guenther <rguenther@suse.de>
Thu, 15 May 2008 10:36:18 +0000 (10:36 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Thu, 15 May 2008 10:36:18 +0000 (10:36 +0000)
2008-05-15  Richard Guenther  <rguenther@suse.de>

* tree-dfa.c (refs_may_alias_p): Allow all kinds of
INDIRECT_REF and TARGET_MEM_REF.
* tree-ssa-sccvn.c (copy_reference_ops_from_ref): Handle
TARGET_MEM_REF.

From-SVN: r135332

gcc/ChangeLog
gcc/tree-dfa.c
gcc/tree-ssa-sccvn.c

index a76ec9d81ef89abb5b37c8a7e093794390fd9300..9a91ab4ea905a6aa9c9cdec711ae85a2019d53a7 100644 (file)
@@ -1,3 +1,10 @@
+2008-05-15  Richard Guenther  <rguenther@suse.de>
+
+       * tree-dfa.c (refs_may_alias_p): Allow all kinds of
+       INDIRECT_REF and TARGET_MEM_REF.
+       * tree-ssa-sccvn.c (copy_reference_ops_from_ref): Handle
+       TARGET_MEM_REF.
+
 2008-05-15  Uros Bizjak  <ubizjak@gmail.com>
            H.J. Lu  <hongjiu.lu@intel.com>
 
index 622930ff5d3d81bf527b0351878be30f687fa5e6..f9784411e411fda7b51891e02eec6a5c817947a4 100644 (file)
@@ -996,10 +996,12 @@ refs_may_alias_p (tree ref1, tree ref2)
 
   gcc_assert ((SSA_VAR_P (ref1)
               || handled_component_p (ref1)
-              || TREE_CODE (ref1) == INDIRECT_REF)
+              || INDIRECT_REF_P (ref1)
+              || TREE_CODE (ref1) == TARGET_MEM_REF)
              && (SSA_VAR_P (ref2)
                  || handled_component_p (ref2)
-                 || TREE_CODE (ref2) == INDIRECT_REF));
+                 || INDIRECT_REF_P (ref2)
+                 || TREE_CODE (ref2) == TARGET_MEM_REF));
 
   /* Defer to TBAA if possible.  */
   if (flag_strict_aliasing
index f5ec0a737b4ca0bf97317f05014509cfb911bf2b..e8eb437d3e607ca97a259b338ee1aa8573c844f8 100644 (file)
@@ -504,6 +504,27 @@ copy_reference_ops_from_ref (tree ref, VEC(vn_reference_op_s, heap) **result)
       return;
     }
 
+  if (TREE_CODE (ref) == TARGET_MEM_REF)
+    {
+      vn_reference_op_s temp;
+
+      memset (&temp, 0, sizeof (temp));
+      /* We do not care for spurious type qualifications.  */
+      temp.type = TYPE_MAIN_VARIANT (TREE_TYPE (ref));
+      temp.opcode = TREE_CODE (ref);
+      temp.op0 = TMR_SYMBOL (ref) ? TMR_SYMBOL (ref) : TMR_BASE (ref);
+      temp.op1 = TMR_INDEX (ref);
+      VEC_safe_push (vn_reference_op_s, heap, *result, &temp);
+
+      memset (&temp, 0, sizeof (temp));
+      temp.type = NULL_TREE;
+      temp.opcode = TREE_CODE (ref);
+      temp.op0 = TMR_STEP (ref);
+      temp.op1 = TMR_OFFSET (ref);
+      VEC_safe_push (vn_reference_op_s, heap, *result, &temp);
+      return;
+    }
+
   /* For non-calls, store the information that makes up the address.  */
 
   while (ref)