From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 90032A00C5; Thu, 7 May 2020 14:03:10 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E6C391DBED; Thu, 7 May 2020 14:03:09 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 8FDC91DBED for ; Thu, 7 May 2020 14:03:08 +0200 (CEST) IronPort-SDR: k93hKa17nt1x+8rO8pBd4bBFih6066GYrxEsWlLsRkpkulNHXbKtcxOHTp12Nue8U26oMuhdGY +RFgyWNOjf5A== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 May 2020 05:03:07 -0700 IronPort-SDR: eLpIUBe8obaIhZN+EhnlFZ19Vb6B9DjjPNOtf85zE9b9FzXYUunhnMS7fvAJC+rA16nIJyAXxY dmDqfhuX/GUA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,363,1583222400"; d="scan'208";a="462122510" Received: from silpixa00399752.ir.intel.com (HELO silpixa00399752.ger.corp.intel.com) ([10.237.222.180]) by fmsmga006.fm.intel.com with ESMTP; 07 May 2020 05:03:06 -0700 From: Ferruh Yigit To: Jerin Jacob , Nithin Dabilpuram Cc: dev@dpdk.org, Ferruh Yigit , Thomas Monjalon , David Marchand Date: Thu, 7 May 2020 13:02:58 +0100 Message-Id: <20200507120259.2197813-2-ferruh.yigit@intel.com> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20200507120259.2197813-1-ferruh.yigit@intel.com> References: <20200507120259.2197813-1-ferruh.yigit@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH 2/3] mempool/octeontx2: fix build for gcc O1 optimization X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Can be reproduced with "make EXTRA_CFLAGS='-O1'" command using gcc (GCC) 9.3.1 20200408 (Red Hat 9.3.1-2) Build error: In file included from .../drivers/mempool/octeontx2/otx2_mempool.h:13, from .../drivers/mempool/octeontx2/otx2_mempool_ops.c:8: .../drivers/mempool/octeontx2/otx2_mempool_ops.c: In function ‘otx2_npa_alloc’: .../drivers/common/octeontx2/otx2_common.h:94:2: error: ‘aura_handle’ may be used uninitialized in this function [-Werror=maybe-uninitialized] 94 | rte_log(RTE_LOG_DEBUG, otx2_logtype_ ## subsystem, \ | ^~~~~~~ .../drivers/mempool/octeontx2/otx2_mempool_ops.c:643:11: note: ‘aura_handle’ was declared here 643 | uint64_t aura_handle; | ^~~~~~~~~~~ This looks like false positive, assigning an initial value to 'aura_handle' to fix the build error. Signed-off-by: Ferruh Yigit --- This is assuming assigning initial value won't have a performance affect if it does, we need to find another fix. And overall not sure why this false positive warning is generated. --- drivers/mempool/octeontx2/otx2_mempool_ops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mempool/octeontx2/otx2_mempool_ops.c b/drivers/mempool/octeontx2/otx2_mempool_ops.c index 162b7f01da..078ffac3e2 100644 --- a/drivers/mempool/octeontx2/otx2_mempool_ops.c +++ b/drivers/mempool/octeontx2/otx2_mempool_ops.c @@ -640,7 +640,7 @@ otx2_npa_alloc(struct rte_mempool *mp) struct otx2_npa_lf *lf; struct npa_aura_s aura; struct npa_pool_s pool; - uint64_t aura_handle; + uint64_t aura_handle = 0; size_t padding; int rc; -- 2.25.4