public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-3415] tree-optimization/102183 - sccvn: fix result compare in vn_nary_op_insert_into
@ 2021-09-08 10:52 Di Zhao
  0 siblings, 0 replies; only message in thread
From: Di Zhao @ 2021-09-08 10:52 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:7285f394558980d1c7211f83c62b692af3c094eb

commit r12-3415-g7285f394558980d1c7211f83c62b692af3c094eb
Author: Di Zhao <dizhao@os.amperecomputing.com>
Date:   Wed Sep 8 15:34:27 2021 +0800

    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

Diff:
---
 gcc/tree-ssa-sccvn.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/tree-ssa-sccvn.c b/gcc/tree-ssa-sccvn.c
index 2357bbdbf90..bfa516b6cf9 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)


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-09-08 10:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-08 10:52 [gcc r12-3415] tree-optimization/102183 - sccvn: fix result compare in vn_nary_op_insert_into Di Zhao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).