public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <richard.guenther@gmail.com>
To: "Kewen.Lin" <linkw@linux.ibm.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] vect: Initialize new_temp to avoid false positive warning [PR110652]
Date: Mon, 17 Jul 2023 08:39:06 +0200	[thread overview]
Message-ID: <CAFiYyc1ZVjzkRDvV_x0AwJZW1FC_a1QmmNY+i07tmjVU=HmSyg@mail.gmail.com> (raw)
In-Reply-To: <8baf564b-e742-0b95-c052-53b1082db372@linux.ibm.com>

On Mon, Jul 17, 2023 at 4:22 AM Kewen.Lin <linkw@linux.ibm.com> wrote:
>
> Hi,
>
> As PR110652 and its duplicate PRs show, there could be one
> build error
>
>   error: 'new_temp' may be used uninitialized
>
> for some build configurations.  It's a false positive warning
> (or error at -Werror), but in order to make the build succeed,
> this patch is to initialize the reported variable 'new_temp'
> as NULL_TREE.
>
> Confirmed this patch fixed the reported issue in PR110652
> (with the same configuration).
>
> Is it ok for trunk?

OK.

> BR,
> Kewen
> -----
>         PR tree-optimization/110652
>
> gcc/ChangeLog:
>
>         * tree-vect-stmts.cc (vectorizable_load): Initialize new_temp as
>         NULL_TREE.
> ---
>  gcc/tree-vect-stmts.cc | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/gcc/tree-vect-stmts.cc b/gcc/tree-vect-stmts.cc
> index c08d0ef951f..cb86d544313 100644
> --- a/gcc/tree-vect-stmts.cc
> +++ b/gcc/tree-vect-stmts.cc
> @@ -9297,7 +9297,8 @@ vectorizable_load (vec_info *vinfo,
>    class loop *containing_loop = gimple_bb (stmt_info->stmt)->loop_father;
>    bool nested_in_vect_loop = false;
>    tree elem_type;
> -  tree new_temp;
> +  /* Avoid false positive uninitialized warning, see PR110652.  */
> +  tree new_temp = NULL_TREE;
>    machine_mode mode;
>    tree dummy;
>    tree dataref_ptr = NULL_TREE;
> --
> 2.31.1

  reply	other threads:[~2023-07-17  6:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-17  2:22 Kewen.Lin
2023-07-17  6:39 ` Richard Biener [this message]
2023-07-17  8:48   ` Kewen.Lin

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='CAFiYyc1ZVjzkRDvV_x0AwJZW1FC_a1QmmNY+i07tmjVU=HmSyg@mail.gmail.com' \
    --to=richard.guenther@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=linkw@linux.ibm.com \
    /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).