Message ID | 20230616113514.327122-1-pan2.li@intel.com |
---|---|
State | Unresolved |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp1273002vqr; Fri, 16 Jun 2023 04:36:07 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7Gxgk59/5UvNb8aitD5fikh1ifo08RR6LQ3BSffcvknl4+corovaOS+ud0UOGhZJqAQ6gf X-Received: by 2002:a17:907:2da6:b0:978:8746:bd75 with SMTP id gt38-20020a1709072da600b009788746bd75mr2019313ejc.58.1686915365282; Fri, 16 Jun 2023 04:36:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686915364; cv=none; d=google.com; s=arc-20160816; b=v5UciheMGDCQYEu+PCuGyyhJ8+Zko34Y/VAjWXN4PVhbUaQI90cXb9U0C/16s0TfBM ptsbB9uNPovCENmH3mpI3exoEVspaT/U/BWLW7pW4sylySoaY7DIJWJF4Ys3z0YBmM6x 9ZmZsPLQitgjRqDEb5zO0GXslLZbf1eT1FOes2JWlm3vdKHVlE2zbw9qWXcyOot+AqNU C4LcMnHU1Uw+GDCfBLjgBhhLPg+zJrsIrXbexwD0v0HPHzcsA8fQuwnvXJecvhR5EX0I hx27RNcVJFq32YCWH70TlEXeqpDc4s9eZ49mfW90/OqBf4UAYtUwqwsoef0Byx7Zz9fd ZgDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:message-id:date:subject:cc :to:dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=0WZR2NF4AlH2dlXuymScuTBX7Xi10dIwFOkPtaftwB4=; b=EcZ8qJ4lPuwrixoR/Gc0HwYA2uQYt1sxyzBcLjjWOxVpN/+slJSky6xHmYJwNM6GDG d3k57qs9GUCumEvJVyuZsNCaBAOWfaGVC8d13uXDXXVyMmxyJi+1tIssA4HqKCkT49Os Oe7M8QdeDGYxkfiKGtsbbLl0oKPI6s8oxoyykjzO5FLbggwtE8LHiqEgVHdLTNnBepez mzYmABRUHMORp2fCQnaWJDG14wabKXWkQUrJm+xjdMxi8b6PQM98ObQriLwxQLIMEhQ7 JFz//1XWeurQ5I+nusrzoR4hZLDv4EJ8R0LTn6ye8YrgzbpP4CnZ7sRzf3sthi2THVlM U6SQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=pgDrafI0; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id f20-20020a170906049400b0096f8c9e7e1esi11115553eja.930.2023.06.16.04.36.04 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Jun 2023 04:36:04 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=pgDrafI0; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9315A3858410 for <ouuuleilei@gmail.com>; Fri, 16 Jun 2023 11:36:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9315A3858410 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1686915363; bh=0WZR2NF4AlH2dlXuymScuTBX7Xi10dIwFOkPtaftwB4=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=pgDrafI0vC6IDb4ZWelJ5pJbfPznTLET6poWmFfFuU2BJQ6Q4m6kFh59+Sji0HDk5 2a0rkxrGuulPA1wl3bYEUIAP0gV5Q20Ctx/IZTOxeXeG8/NfAXeAnfufJ+kAIYy5iZ 2h2t6QcDPH3gITDISf8I4dklT8cFfa4+jYP36B10= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by sourceware.org (Postfix) with ESMTPS id 3B3A93858D35 for <gcc-patches@gcc.gnu.org>; Fri, 16 Jun 2023 11:35:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3B3A93858D35 X-IronPort-AV: E=McAfee;i="6600,9927,10742"; a="356684739" X-IronPort-AV: E=Sophos;i="6.00,247,1681196400"; d="scan'208";a="356684739" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jun 2023 04:35:19 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10742"; a="857351637" X-IronPort-AV: E=Sophos;i="6.00,247,1681196400"; d="scan'208";a="857351637" Received: from shvmail03.sh.intel.com ([10.239.245.20]) by fmsmga001.fm.intel.com with ESMTP; 16 Jun 2023 04:35:16 -0700 Received: from pli-ubuntu.sh.intel.com (pli-ubuntu.sh.intel.com [10.239.159.47]) by shvmail03.sh.intel.com (Postfix) with ESMTP id 22DB71005691; Fri, 16 Jun 2023 19:35:16 +0800 (CST) To: gcc-patches@gcc.gnu.org Cc: juzhe.zhong@rivai.ai, rdapp.gcc@gmail.com, jeffreyalaw@gmail.com, pan2.li@intel.com, yanzhang.wang@intel.com, kito.cheng@gmail.com Subject: [PATCH v1] RISC-V: Fix one warning of maybe-uninitialized in riscv-vsetvl.cc Date: Fri, 16 Jun 2023 19:35:14 +0800 Message-Id: <20230616113514.327122-1-pan2.li@intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.2 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_NONE, 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 X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> From: Pan Li via Gcc-patches <gcc-patches@gcc.gnu.org> Reply-To: pan2.li@intel.com Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768858965331339112?= X-GMAIL-MSGID: =?utf-8?q?1768858965331339112?= |
Series |
[v1] RISC-V: Fix one warning of maybe-uninitialized in riscv-vsetvl.cc
|
|
Checks
Context | Check | Description |
---|---|---|
snail/gcc-patch-check | warning | Git am fail log |
Commit Message
Li, Pan2 via Gcc-patches
June 16, 2023, 11:35 a.m. UTC
From: Pan Li <pan2.li@intel.com> This patch would like to fix one maybe-uninitialized warning. Aka: riscv-vsetvl.cc:4354:3: error: 'vsetvl_rinsn' may be used uninitialized [-Werror=maybe-uninitialized] Signed-off-by: Pan Li <pan2.li@intel.com> gcc/ChangeLog: * config/riscv/riscv-vsetvl.cc (pass_vsetvl::global_eliminate_vsetvl_insn): Initialize var by NULL. --- gcc/config/riscv/riscv-vsetvl.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Comments
> This patch would like to fix one maybe-uninitialized warning. Aka: > > riscv-vsetvl.cc:4354:3: error: 'vsetvl_rinsn' may be used uninitialized [-Werror=maybe-uninitialized] > > Signed-off-by: Pan Li <pan2.li@intel.com> IMHO obvious enough that it doesn't need a maintainer's OK, so go ahead. We should make sure to find such nits before Andreas does in the future, though, as we don't want to waste his time. This means either proper bootstrapping or always configuring with -Werror=all (or similar). The latter should catch most and is less intrusive. Regards Robin
Committed, thanks Robin. Pan -----Original Message----- From: Robin Dapp <rdapp.gcc@gmail.com> Sent: Friday, June 16, 2023 7:41 PM To: Li, Pan2 <pan2.li@intel.com>; gcc-patches@gcc.gnu.org Cc: rdapp.gcc@gmail.com; juzhe.zhong@rivai.ai; jeffreyalaw@gmail.com; Wang, Yanzhang <yanzhang.wang@intel.com>; kito.cheng@gmail.com Subject: Re: [PATCH v1] RISC-V: Fix one warning of maybe-uninitialized in riscv-vsetvl.cc > This patch would like to fix one maybe-uninitialized warning. Aka: > > riscv-vsetvl.cc:4354:3: error: 'vsetvl_rinsn' may be used uninitialized [-Werror=maybe-uninitialized] > > Signed-off-by: Pan Li <pan2.li@intel.com> IMHO obvious enough that it doesn't need a maintainer's OK, so go ahead. We should make sure to find such nits before Andreas does in the future, though, as we don't want to waste his time. This means either proper bootstrapping or always configuring with -Werror=all (or similar). The latter should catch most and is less intrusive. Regards Robin
diff --git a/gcc/config/riscv/riscv-vsetvl.cc b/gcc/config/riscv/riscv-vsetvl.cc index cae9be0d928..7066dea3d14 100644 --- a/gcc/config/riscv/riscv-vsetvl.cc +++ b/gcc/config/riscv/riscv-vsetvl.cc @@ -4340,7 +4340,7 @@ get_first_vsetvl_before_rvv_insns (basic_block cfg_bb) bool pass_vsetvl::global_eliminate_vsetvl_insn (const bb_info *bb) const { - rtx_insn *vsetvl_rinsn; + rtx_insn *vsetvl_rinsn = NULL; vector_insn_info dem = vector_insn_info (); const auto &block_info = get_block_info (bb); basic_block cfg_bb = bb->cfg_bb ();