tree-ssa-sccvn.c (vn_reference_lookup_3): Use a uniform test and update shared_lookup...
authorEric Botcazou <ebotcazou@adacore.com>
Mon, 13 Jun 2016 17:44:12 +0000 (17:44 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Mon, 13 Jun 2016 17:44:12 +0000 (17:44 +0000)
* tree-ssa-sccvn.c (vn_reference_lookup_3): Use a uniform test and
update shared_lookup_references only once after changing operands.

From-SVN: r237388

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

index 89098e7db11fe29da65f669a4808019d839d3d6e..b1026bdcf47dd7130d5f304b47c912416311d234 100644 (file)
@@ -1,3 +1,8 @@
+2016-06-13  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * tree-ssa-sccvn.c (vn_reference_lookup_3): Use a uniform test and
+       update shared_lookup_references only once after changing operands.
+
 2016-06-13  Thomas Schwinge  <thomas@codesourcery.com>
 
        PR middle-end/71373
index 730db04ff8bfa47f3b07aba9eac591fce8af37cf..0cbd2cd56f24bba09f95fe9d6ae50a62535cca6d 100644 (file)
@@ -2089,11 +2089,7 @@ vn_reference_lookup_3 (ao_ref *ref, tree vuse, void *vr_,
       /* We need to pre-pend vr->operands[0..i] to rhs.  */
       vec<vn_reference_op_s> old = vr->operands;
       if (i + 1 + rhs.length () > vr->operands.length ())
-       {
-         vr->operands.safe_grow (i + 1 + rhs.length ());
-         if (old == shared_lookup_references)
-           shared_lookup_references = vr->operands;
-       }
+       vr->operands.safe_grow (i + 1 + rhs.length ());
       else
        vr->operands.truncate (i + 1 + rhs.length ());
       FOR_EACH_VEC_ELT (rhs, j, vro)
@@ -2244,8 +2240,7 @@ vn_reference_lookup_3 (ao_ref *ref, tree vuse, void *vr_,
        {
          vec<vn_reference_op_s> old = vr->operands;
          vr->operands.safe_grow_cleared (2);
-         if (old == shared_lookup_references
-             && vr->operands != old)
+         if (old == shared_lookup_references)
            shared_lookup_references = vr->operands;
        }
       else