diff options
author | Di Zhao <dizhao@os.amperecomputing.com> | 2021-09-08 15:34:27 +0800 |
---|---|---|
committer | Di Zhao <dizhao@os.amperecomputing.com> | 2021-09-08 18:47:18 +0800 |
commit | 7285f394558980d1c7211f83c62b692af3c094eb (patch) | |
tree | 9c2cc6e012c71253380b95bd2932e8c502162046 | |
parent | 87d55da7d78f64bfce5e8217379d46bdc9ab287b (diff) | |
download | gcc-7285f394558980d1c7211f83c62b692af3c094eb.zip gcc-7285f394558980d1c7211f83c62b692af3c094eb.tar.gz gcc-7285f394558980d1c7211f83c62b692af3c094eb.tar.bz2 |
tree-optimization/102183 - sccvn: fix result compare in vn_nary_op_insert_into
If the first predicate value is different and copied, the comparison will then
be between val->result and the copied one. That can cause inserting extra
vn_pvals.
gcc/ChangeLog:
* tree-ssa-sccvn.c (vn_nary_op_insert_into): fix result compare
-rw-r--r-- | gcc/tree-ssa-sccvn.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/tree-ssa-sccvn.c b/gcc/tree-ssa-sccvn.c index 2357bbd..bfa516b 100644 --- a/gcc/tree-ssa-sccvn.c +++ b/gcc/tree-ssa-sccvn.c @@ -4105,7 +4105,7 @@ vn_nary_op_insert_into (vn_nary_op_t vno, vn_nary_op_table_type *table, bool found = false; for (vn_pval *val = (*slot)->u.values; val; val = val->next) { - if (expressions_equal_p (val->result, vno->u.values->result)) + if (expressions_equal_p (val->result, nval->result)) { found = true; for (unsigned i = 0; i < val->n; ++i) |