re PR tree-optimization/44656 (VN should value-replace operands during alias-oracle...
authorRichard Guenther <rguenther@suse.de>
Sun, 4 Jul 2010 10:52:43 +0000 (10:52 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Sun, 4 Jul 2010 10:52:43 +0000 (10:52 +0000)
2010-07-04  Richard Guenther  <rguenther@suse.de>

PR tree-optimization/44656
* tree-ssa-sccvn.c (vn_reference_lookup_3): Try disambiguation
again after value-replacing in the defintions lhs.

* gcc.dg/tree-ssa/loadpre6.c: Remove XFAIL.

From-SVN: r161798

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/tree-ssa/loadpre6.c
gcc/tree-ssa-sccvn.c

index c69bc6ce812b0b6607a1dbb45acdbc9231617622..fb5486576c046303afd056ddf265ffac436adf94 100644 (file)
@@ -1,3 +1,9 @@
+2010-07-04  Richard Guenther  <rguenther@suse.de>
+
+       PR tree-optimization/44656
+       * tree-ssa-sccvn.c (vn_reference_lookup_3): Try disambiguation
+       again after value-replacing in the defintions lhs.
+
 2010-07-04  Ira Rosen  <irar@il.ibm.com>
            Revital Eres  <eres@il.ibm.com>
 
index 5ae6c6ebe4f3e70c51fbc6f50bc0005b2d3a1475..fe74d60b4eaea39270a5e114b90802986570b116 100644 (file)
@@ -1,3 +1,8 @@
+2010-07-04  Richard Guenther  <rguenther@suse.de>
+
+       PR tree-optimization/44656
+       * gcc.dg/tree-ssa/loadpre6.c: Remove XFAIL.
+
 2010-07-04  Ira Rosen  <irar@il.ibm.com>
            Revital Eres  <eres@il.ibm.com>
 
index 4b8239e4531603aec8489353e8445c3e90bc25d4..242727d260f9c2c6de9848c35ac874e1551c701f 100644 (file)
@@ -73,8 +73,7 @@ main (void)
   return 0;
 }
 
-/* See PR44656.  The last elimination is only done by PRE.  */
-/* { dg-final { scan-tree-dump-not "= unexpanded_var_list;" "fre" { xfail *-*-* } } } */
-/* { dg-final { scan-tree-dump-times "Eliminated: 1" 2 "pre" } } */
+/* { dg-final { scan-tree-dump-not "= unexpanded_var_list;" "fre" } } */
+/* { dg-final { scan-tree-dump-times "Eliminated: 1" 1 "pre" } } */
 /* { dg-final { scan-tree-dump-times "Insertions: 2" 1 "pre" } } */
 /* { dg-final { cleanup-tree-dump "pre" } } */
index cc667207ee0e44eb450f3dbe70a2dca13de508b2..cca1941f7b35b29cad9d7f7abbf59caf0b7c162d 100644 (file)
@@ -1212,6 +1212,23 @@ vn_reference_lookup_3 (ao_ref *ref, tree vuse, void *vr_)
   tree base;
   HOST_WIDE_INT offset, maxsize;
 
+  /* First try to disambiguate after value-replacing in the definitions LHS.  */
+  if (is_gimple_assign (def_stmt))
+    {
+      tree lhs = gimple_assign_lhs (def_stmt);
+      ao_ref ref1;
+      VEC (vn_reference_op_s, heap) *operands = NULL;
+      bool res;
+      copy_reference_ops_from_ref (lhs, &operands);
+      operands = valueize_refs (operands);
+      ao_ref_init_from_vn_reference (&ref1, get_alias_set (lhs),
+                                    TREE_TYPE (lhs), operands);
+      res = refs_may_alias_p_1 (ref, &ref1, true);
+      VEC_free (vn_reference_op_s, heap, operands);
+      if (!res)
+       return NULL;
+    }
+
   base = ao_ref_base (ref);
   offset = ref->offset;
   maxsize = ref->max_size;