Message ID | 20220917005949.263893-1-juzhe.zhong@rivai.ai |
---|---|
State | New, archived |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5044:0:0:0:0:0 with SMTP id h4csp1925wrt; Fri, 16 Sep 2022 18:00:40 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6ckhjoOiBS6ddzT1r4IhtA434viUCpx6d2BkcEJDep+ymFHwSUA7fcWozRXFIaWm78upIb X-Received: by 2002:a17:907:c22:b0:77c:32e9:f056 with SMTP id ga34-20020a1709070c2200b0077c32e9f056mr5228318ejc.768.1663376440186; Fri, 16 Sep 2022 18:00:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663376440; cv=none; d=google.com; s=arc-20160816; b=wrkT5fvb5mVVfNlVP8udIcwbjRurIE/B/U+BI5gD0L+vRGjfxNeNBLNesT5w+juCrB x2JZyX2k8oEgwsdidWiUp0HK+fVhPwSd1GVEXqNSK+EZ8KfIiHS+pvGL7Cbf7DS67FlG ojcjnIsDc3F51YxN1sgYkqzalfLl8rGd7d31/omZmi5iqp6KFga1zC322IlOr1soc78m dRBqIEqnA6MZdA6/jNi5cpY9NCiZUpRTVXYvJjUpCdIChqSsPd30Y5Ys9LuAHr01Is8V +RvsNyGe7OIrrPRUMKd9t74J40RcsfR1vFxvmG4gbkBCWDCzK/3Khem9pwdNP2z709VH CpMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:feedback-id :content-transfer-encoding:mime-version:message-id:date:subject:to :from:dmarc-filter:delivered-to; bh=lJ0ex1uIulKV2JjWmGqIdlKMg84yR/VTDrPBGpyuMMM=; b=MmAXlcFXH0tpMlq+0YIAFTgRnmJwbOpJYJxNqqMAwlrUVdSThI7bUk5rhItc5f+5JW xv2vgLH8pRm0zcA513NtK2u2VM3Lvr8hNGuxaHftF6BoMynsLhqnvo++C5B4HcaSkHCt TaW0kJJMVL8BORmLTrYFIztrj/5w7eytCueBpuxEChh+Qe6TQ7l7OP06NA5dKENwZLQd i44bpMNBEfKaFzBNrkjwZVutcn3vzk8yWXIzBwlH0tt112m1I2nRRLT1pPZ6sTeWj4d9 S2jECAt2DjGvw66YhIO964Pl2QXo5YTFXcejCpWNVmMxe1TVmWnwsIZHSGrAx/5Ohyp4 KBHg== ARC-Authentication-Results: i=1; mx.google.com; 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" Received: from sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id dd11-20020a1709069b8b00b007803b10cc5bsi9307112ejc.614.2022.09.16.18.00.39 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Sep 2022 18:00:40 -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; 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" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DA3C43851C1A for <ouuuleilei@gmail.com>; Sat, 17 Sep 2022 01:00:31 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtpbgau1.qq.com (smtpbgau1.qq.com [54.206.16.166]) by sourceware.org (Postfix) with ESMTPS id B961E38582AD for <gcc-patches@gcc.gnu.org>; Sat, 17 Sep 2022 01:00:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B961E38582AD Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=rivai.ai Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=rivai.ai X-QQ-mid: bizesmtp71t1663376393trsa02cn Received: from rios-cad5.localdomain ( [42.247.22.66]) by bizesmtp.qq.com (ESMTP) with id ; Sat, 17 Sep 2022 08:59:51 +0800 (CST) X-QQ-SSF: 00400000000000D0J000000A0000000 X-QQ-FEAT: D6RqbDSxuq4xqikScZEudh+do2XbVCzTct4iOn9aDsVOqisNfaS0Hlf+Vksqb yBSxSzdOszmCkU6+uhCIFL921wM0zcIIUSt6Yskd4kjtFKhJnFns3w9ubsJQV/th12pVVsK LYngUM607ZOo8zDzDdnuEhuqvxnELd+GNfq/zFaEgDHjlv7rbg1ezKyGtRjTZMXIXJaKJQx vSwXIkSrRxeZW0XGz/GfsNaiTL9MdkOvlZgh6Sgiz6aT+uLkZJAV/432bnrYuJYRazbzAUh AS27/d4RQsRGEvO0GLPwU5oTgjxBwBwAQfMfcyykYMlNbZ+mQf9vvAjWx304CBLNHApErnH VMAcRheat0U9RPBQHQScKS0YJ0XYnby1vqMWaEGrxsp8WPuUDCmqHjW9IWmHd3l6NdGt1sF X-QQ-GoodBg: 2 From: juzhe.zhong@rivai.ai To: gcc-patches@gcc.gnu.org Subject: [PATCH] RISC-V: Suppress riscv-selftests.cc warning. Date: Sat, 17 Sep 2022 08:59:49 +0800 Message-Id: <20220917005949.263893-1-juzhe.zhong@rivai.ai> X-Mailer: git-send-email 2.36.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:rivai.ai:qybglogicsvr:qybglogicsvr7 X-Spam-Status: No, score=-12.8 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, KAM_SHORT, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP 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> Cc: kito.cheng@gmail.com, Ju-Zhe Zhong <juzhe.zhong@rivai.ai> 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?1744176614147291282?= X-GMAIL-MSGID: =?utf-8?q?1744176614147291282?= |
Series |
RISC-V: Suppress riscv-selftests.cc warning.
|
|
Commit Message
juzhe.zhong@rivai.ai
Sept. 17, 2022, 12:59 a.m. UTC
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(-)
Comments
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> ®no_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 >
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> ®no_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);