public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Kito Cheng <kito.cheng@gmail.com>
To: juzhe.zhong@rivai.ai
Cc: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] RISC-V: Suppress riscv-selftests.cc warning.
Date: Fri, 23 Sep 2022 23:35:38 +0800	[thread overview]
Message-ID: <CA+yXCZBA6ntBdcRY_bpQdEHHX6OiC8Ti5NTDmOLGkO9Ge=ynng@mail.gmail.com> (raw)
In-Reply-To: <20220917005949.263893-1-juzhe.zhong@rivai.ai>

Committed, but squashed changes to "RISC-V: Support poly move
manipulation and selftests." instead of a standalone commit.

On Sat, Sep 17, 2022 at 9:00 AM <juzhe.zhong@rivai.ai> wrote:
>
> From: Ju-Zhe Zhong <juzhe.zhong@rivai.ai>
>
> This patch is a fix patch for:
> https://gcc.gnu.org/pipermail/gcc-patches/2022-September/601643.html
>
> Suppress the warning as follows:
>
> ../../../riscv-gcc/gcc/poly-int.h: In function
> ‘poly_int64 eval_value(rtx, std::map<unsigned int, rtx_def*>&)’:
> ../../../riscv-gcc/gcc/poly-int.h:845:48: warning:
> ‘*((void*)& op2_val +8)’ may be used uninitialized
> in this function [-Wmaybe-uninitialized]
>      POLY_SET_COEFF (C, r, i, NCa (a.coeffs[i]) + b.coeffs[i]);
>                                                 ^
> ../../../riscv-gcc/gcc/config/riscv/riscv-selftests.cc:74:23:
> note: ‘*((void*)& op2_val +8)’ was declared here
>    poly_int64 op1_val, op2_val;
>
> gcc/ChangeLog:
>
>         * config/riscv/riscv-selftests.cc (eval_value): Add initial value.
>
> ---
>  gcc/config/riscv/riscv-selftests.cc | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/gcc/config/riscv/riscv-selftests.cc b/gcc/config/riscv/riscv-selftests.cc
> index 167cd47c880..490b6ed6b8e 100644
> --- a/gcc/config/riscv/riscv-selftests.cc
> +++ b/gcc/config/riscv/riscv-selftests.cc
> @@ -71,7 +71,8 @@ eval_value (rtx x, std::map<unsigned, rtx> &regno_to_rtx)
>    unsigned regno = REGNO (x);
>    expr = regno_to_rtx[regno];
>
> -  poly_int64 op1_val, op2_val;
> +  poly_int64 op1_val = 0;
> +  poly_int64 op2_val = 0;
>    if (UNARY_P (expr))
>      {
>        op1_val = eval_value (XEXP (expr, 0), regno_to_rtx);
> --
> 2.36.1
>

      reply	other threads:[~2022-09-23 15:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-17  0:59 juzhe.zhong
2022-09-23 15:35 ` Kito Cheng [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='CA+yXCZBA6ntBdcRY_bpQdEHHX6OiC8Ti5NTDmOLGkO9Ge=ynng@mail.gmail.com' \
    --to=kito.cheng@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=juzhe.zhong@rivai.ai \
    /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).