tree-ssa-sccvn.c (vn_reference_lookup_3): Encode valueized RHS.
authorRichard Biener <rguenther@suse.de>
Thu, 27 Jun 2019 10:11:57 +0000 (10:11 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Thu, 27 Jun 2019 10:11:57 +0000 (10:11 +0000)
2019-06-27  Richard Biener  <rguenther@suse.de>

* tree-ssa-sccvn.c (vn_reference_lookup_3): Encode valueized RHS.

* gcc.dg/tree-ssa/ssa-fre-69.c: New testcase.

From-SVN: r272742

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-69.c [new file with mode: 0644]
gcc/tree-ssa-sccvn.c

index 44f9850b671b04dd8893c54e3966748663020b09..0561f1091f28108af66148dba682639a9048c1d8 100644 (file)
@@ -1,3 +1,7 @@
+2019-06-27  Richard Biener  <rguenther@suse.de>
+
+       * tree-ssa-sccvn.c (vn_reference_lookup_3): Encode valueized RHS.
+
 2019-06-27  Jun Ma <JunMa@linux.alibaba.com>
 
        PR tree-optimization/89772
index 3c459a406d2456131bf26fdf3dc0e4328fcf1951..388fd2b55737f33deec6460254c39c5879f844ba 100644 (file)
@@ -1,3 +1,7 @@
+2019-06-27  Richard Biener  <rguenther@suse.de>
+
+       * gcc.dg/tree-ssa/ssa-fre-69.c: New testcase.
+
 2019-06-27  Jun Ma  <JunMa@linux.alibaba.com>
 
        PR tree-optimization/89772
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-69.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-69.c
new file mode 100644 (file)
index 0000000..e2ce28e
--- /dev/null
@@ -0,0 +1,32 @@
+/* { dg-do compile } */
+/* { dg-options "-fgimple -O1 -fdump-tree-fre1" } */
+
+int a[10];
+typedef int v2si __attribute__((vector_size(__SIZEOF_INT__*2)));
+int __GIMPLE (ssa,guessed_local(97603132),startwith("fre1"))
+     foo ()
+{
+  int i;
+  int _59;
+  int _44;
+  int _13;
+  int _18;
+  v2si _80;
+  v2si _81;
+  int res;
+
+  __BB(2,guessed_local(97603132)):
+  _59 = 64;
+  i_61 = 9;
+  _44 = i_61 * i_61;
+  _80 = _Literal (v2si) {_59, _44};
+  _81 = _80;
+  __MEM <v2si> ((int *)&a + _Literal (int *) 32) = _81;
+  i_48 = 9;
+  _13 = a[8];
+  _18 = a[i_48];
+  res_15 = _13 + _18;
+  return res_15;
+}
+
+/* { dg-final { scan-tree-dump "return 145;" "fre1" } } */
index b4f626000dd01c759c4f11180c4029cd2a6910ff..9c74be074d2761884bf8695b55e6bee855dbcf06 100644 (file)
@@ -2242,7 +2242,7 @@ vn_reference_lookup_3 (ao_ref *ref, tree vuse, void *vr_,
          tree rhs = gimple_assign_rhs1 (def_stmt);
          if (TREE_CODE (rhs) == SSA_NAME)
            rhs = SSA_VAL (rhs);
-         len = native_encode_expr (gimple_assign_rhs1 (def_stmt),
+         len = native_encode_expr (rhs,
                                    buffer, sizeof (buffer),
                                    (offseti - offset2) / BITS_PER_UNIT);
          if (len > 0 && len * BITS_PER_UNIT >= maxsizei)