From patchwork Sat Sep 17 00:59:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "juzhe.zhong@rivai.ai" X-Patchwork-Id: 57710 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 321BF3895FF3 for ; Sat, 17 Sep 2022 01:00:24 +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 ; 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 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kito.cheng@gmail.com, Ju-Zhe Zhong Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" From: Ju-Zhe Zhong 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&)’: ../../../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 ®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);