tree-ssa-sccvn.c (vn_reference_eq): Also compare if both bases are dereferenced.
authorRichard Guenther <rguenther@suse.de>
Wed, 25 Jan 2012 15:36:43 +0000 (15:36 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Wed, 25 Jan 2012 15:36:43 +0000 (15:36 +0000)
2012-01-25  Richard Guenther  <rguenther@suse.de>

* tree-ssa-sccvn.c (vn_reference_eq): Also compare if both
bases are dereferenced.

From-SVN: r183522

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

index f0940907ce5fa2bd11dab10f6f68aecfd4c2106a..a671f6931114f940c2cb3688acb2c483e49ec013 100644 (file)
@@ -1,3 +1,8 @@
+2012-01-25  Richard Guenther  <rguenther@suse.de>
+
+       * tree-ssa-sccvn.c (vn_reference_eq): Also compare if both
+       bases are dereferenced.
+
 2012-01-25  Andrey Belevantsev  <abel@ispras.ru>
 
        PR rtl-optimization/48374
index ca11ca1cdfcf3246e76b6acb8a339fb4a18d021e..1f0360011e3d553f59a272d1133e67e1518a88d1 100644 (file)
@@ -556,6 +556,7 @@ vn_reference_eq (const void *p1, const void *p2)
          tem1.type = TREE_TYPE (tem1.op0);
          tem1.opcode = TREE_CODE (tem1.op0);
          vro1 = &tem1;
+         deref1 = false;
        }
       if (deref2 && vro2->opcode == ADDR_EXPR)
        {
@@ -564,7 +565,10 @@ vn_reference_eq (const void *p1, const void *p2)
          tem2.type = TREE_TYPE (tem2.op0);
          tem2.opcode = TREE_CODE (tem2.op0);
          vro2 = &tem2;
+         deref2 = false;
        }
+      if (deref1 != deref2)
+       return false;
       if (!vn_reference_op_eq (vro1, vro2))
        return false;
       ++j;