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

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
This commit is contained in:
Richard Biener 2019-06-27 10:11:57 +00:00 committed by Richard Biener
parent 5fd336bbd7
commit b38f4c1b76
4 changed files with 41 additions and 1 deletions

View 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

View 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

View file

@ -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" } } */

View 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)