From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io1-xd29.google.com (mail-io1-xd29.google.com [IPv6:2607:f8b0:4864:20::d29]) by sourceware.org (Postfix) with ESMTPS id 71C353858439 for ; Mon, 17 Jul 2023 06:39:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 71C353858439 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-io1-xd29.google.com with SMTP id ca18e2360f4ac-78372b896d0so183456339f.2 for ; Sun, 16 Jul 2023 23:39:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689575977; x=1692167977; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=VZmx8fQur4hG9FkQCkpyPH8rOMBwDx1FXI22jtJ0hgA=; b=sTFNPjufh6HUUyJ58WN24+snzdgvZBrvhgGP4EjwVq1r/WEkv9B6ou8aXnnJ2tkWw5 QC1Wy/kCghFEOq6ahe4zvjftTqlDxI3TNdNI1RllAxnIFvXz+iy3Jom7i3wKJZkf/DVW QwW/9CiCOPaZQdja+ssothrMEipZ4IK0QT7wsngcHBd8D9dxBMMkkk+6ozPlxhN1sSmd R/QLfcJfx5R3rhNkNpBx+pNim809ogzSFm6hR1I2CRMU3SMixUfjneSoY4oNfj0OwvbY 3X6sY3w2DkWGPwATeLZb84XAmTtyjzaMaQADu/wRrbGMI/q19XaMTe7IHGOB1KiiNBt9 HicA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689575977; x=1692167977; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=VZmx8fQur4hG9FkQCkpyPH8rOMBwDx1FXI22jtJ0hgA=; b=DpG8z5/8BZlECoo/F9FTxlzwYJQBGrAjDmVkQ0TLzPSlWybu2E5ioQLcqKu1+bPBOg 4H1CVkEnFPFcs+WZPAeNkuHbTzVR79Er5OTOj/Aaofp5+89zbcXpOerZ2G6sFm5OwMR6 17oBea+BDeq7Qkqg3pzPNxuXsZGtJgU2mWnwonQXHK103158jwjmAa5jFVPKKJpwGlqn y1ZN9usnstV7Q8qMh1Ut5fbB1rUF0md5i7GLbIJKtLyvpdN4IvQjgAVhhLTj5NcGpODh V8S82kEAov4C8Scxf5gDZ88CmHOPU/hniKic+5qk0N/rCDmtU0ibSrRJkG3BwanZs/sk z7sA== X-Gm-Message-State: ABy/qLZVDl60cT0tHDh6NekGu9WkpTGNS6m2Yff9LLeUKJBwFbxSuawT ipLGB34yClxEMfLfLFmWBk8vDoTjb8YmB2VjSQPUIrTq X-Google-Smtp-Source: APBJJlEuAh8VJUKxZ9oXlLK5+7TwdoL1b6eVfsOM3sIunLOuumdSU0a62B5v0iwwWFy4yg/9oNfdr+9ZahZToZypDS0= X-Received: by 2002:a05:6e02:216c:b0:348:8da5:a53c with SMTP id s12-20020a056e02216c00b003488da5a53cmr464751ilv.22.1689575977603; Sun, 16 Jul 2023 23:39:37 -0700 (PDT) MIME-Version: 1.0 References: <8baf564b-e742-0b95-c052-53b1082db372@linux.ibm.com> In-Reply-To: <8baf564b-e742-0b95-c052-53b1082db372@linux.ibm.com> From: Richard Biener Date: Mon, 17 Jul 2023 08:39:06 +0200 Message-ID: Subject: Re: [PATCH] vect: Initialize new_temp to avoid false positive warning [PR110652] To: "Kewen.Lin" Cc: GCC Patches Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-8.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Mon, Jul 17, 2023 at 4:22=E2=80=AFAM Kewen.Lin wro= te: > > 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 =3D gimple_bb (stmt_info->stmt)->loop_fath= er; > bool nested_in_vect_loop =3D false; > tree elem_type; > - tree new_temp; > + /* Avoid false positive uninitialized warning, see PR110652. */ > + tree new_temp =3D NULL_TREE; > machine_mode mode; > tree dummy; > tree dataref_ptr =3D NULL_TREE; > -- > 2.31.1