public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <richard.guenther@gmail.com>
To: Di Zhao OS <dizhao@os.amperecomputing.com>
Cc: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] tree-optimization/102183 - sccvn: fix result compare in vn_nary_op_insert_into
Date: Mon, 6 Sep 2021 09:33:06 +0200	[thread overview]
Message-ID: <CAFiYyc1Om+3o723JvHjORPbGYJ1zSXKK+bsqvR8je5WMamxRSg@mail.gmail.com> (raw)
In-Reply-To: <SN6PR01MB42405C16083761ADD68092B2E8D29@SN6PR01MB4240.prod.exchangelabs.com>

On Mon, Sep 6, 2021 at 4:48 AM Di Zhao OS <dizhao@os.amperecomputing.com> wrote:
>
> If the first predicate value is different and copied, the comparison will then be between val->result and the copied one, which seems to be a bug. That can cause inserting extra vn_pvals.
>
> Bootstrapped and tested on x86_64-unknown-linux-gnu.

OK.

Thanks,
Richard.

> Regards,
> Di Zhao
>
> gcc/ChangeLog:
>
>         * tree-ssa-sccvn.c (vn_nary_op_insert_into): fix result compare
> ---
>  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)
> --
> 2.25.1
>
>
>

      reply	other threads:[~2021-09-06  7:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-06  2:48 Di Zhao OS
2021-09-06  7:33 ` Richard Biener [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAFiYyc1Om+3o723JvHjORPbGYJ1zSXKK+bsqvR8je5WMamxRSg@mail.gmail.com \
    --to=richard.guenther@gmail.com \
    --cc=dizhao@os.amperecomputing.com \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).