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 2C4CBA00C4; Sun, 10 May 2020 13:51:32 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 719D51D510; Sun, 10 May 2020 13:51:31 +0200 (CEST) Received: from mail-io1-f68.google.com (mail-io1-f68.google.com [209.85.166.68]) by dpdk.org (Postfix) with ESMTP id E9D201D483 for ; Sun, 10 May 2020 13:51:29 +0200 (CEST) Received: by mail-io1-f68.google.com with SMTP id w11so6514797iov.8 for ; Sun, 10 May 2020 04:51:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=UAKbxDvU+Sq+71GWYX4xiBCEn9a9kHuChTRdll1i5k8=; b=H5FCHrzk5t/uMMjT7ozkcRsZVJ/OCD416X8zf/bTbK4wkMs0EVcd/mFgTFBqVwApx1 0zdjf+eGZaMNjziwuWXj0MKbtE/CFzwheMNgXYx+hKjixDmpgomhB9eipeNqjxbPsSAi V/2DcvpPhIjlHc5MsLZVabwdg5Z6Pl5fDquiWqWo7bMaegkxG7ottFQ5yT1cP6xFLY4F SS3zfeaVuD8o+uM7tBNiYCN+Ts9/GwcUFGt/LDjLRUz7L1zNozAWQaIhe9kSsMt5og5J DdlONAGC8i3HsfSeRtlSYDoTmdkNPBaaCpp4wgNRwTLrQbG2Av9DUIO0UYS/yu8TzSVm 2oww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=UAKbxDvU+Sq+71GWYX4xiBCEn9a9kHuChTRdll1i5k8=; b=k/Q8KMSUgFg+LddAyjE+XycbaL9fK7iiXjg7DkTChzEWs2LjQrvnUM4zdLx4swavqx si+89Qx2eR5peoFLZDvbEuc8UxJpL7K0xdVJG8JGL1x2+LoqPqUZQJcfhZebVOkF95bk g/Cdi68bxl6/Sfe80zlgbuCcuirlSdO9zqKOt/saspVVasV2ZmOZD3KHEl4Mpgf00v29 goS6ri9NSHYlxEAjmAIgMeHVg+rwwXi2V7Ud/klRhNzOiweMe2SrujIDqyzCGHDFwtR4 QdTaf+6GhrB9iBnwpCSlUTvniOUB+bXrkGBWJV00iPtm3olPd0EA+D98aIRcMziQ+u1m BUmw== X-Gm-Message-State: AGi0PuaWnwrHO3fIStyG0nHQxApZW4KSLmNj2RJxJCsVLAgYPfw8AxyZ Ujt0W0y4wtqFlyAELdRNsxHbs9bSOL021kuiGFQ= X-Google-Smtp-Source: APiQypLyC+pJgHQVLv0RsWZgyn7Ec/0mMiswcwq2BygI8FQVY7/Nt9E2fVuXIBHhSWCmgXWI8rC92eYFjhQLUKEkxqQ= X-Received: by 2002:a02:a598:: with SMTP id b24mr4671087jam.104.1589111489041; Sun, 10 May 2020 04:51:29 -0700 (PDT) MIME-Version: 1.0 References: <20200507120259.2197813-1-ferruh.yigit@intel.com> <20200508164546.2489396-1-ferruh.yigit@intel.com> <20200508164546.2489396-2-ferruh.yigit@intel.com> In-Reply-To: <20200508164546.2489396-2-ferruh.yigit@intel.com> From: Jerin Jacob Date: Sun, 10 May 2020 17:21:13 +0530 Message-ID: To: Ferruh Yigit Cc: Jerin Jacob , Nithin Dabilpuram , dpdk-dev , Thomas Monjalon , David Marchand Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [dpdk-dev] [PATCH v2 2/4] 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" On Fri, May 8, 2020 at 10:16 PM Ferruh Yigit wrote= : > > Can be reproduced with "make EXTRA_CFLAGS=3D'-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 =E2=80=98otx2_npa_alloc=E2=80=99: > .../drivers/common/octeontx2/otx2_common.h:94:2: > error: =E2=80=98aura_handle=E2=80=99 may be used uninitialized in thi= s function > [-Werror=3Dmaybe-uninitialized] > 94 | rte_log(RTE_LOG_DEBUG, otx2_logtype_ ## subsystem, \ > | ^~~~~~~ > .../drivers/mempool/octeontx2/otx2_mempool_ops.c:643:11: > note: =E2=80=98aura_handle=E2=80=99 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/mempo= ol/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 =3D 0; It is a false positive. Since it is on a slow path, This workaround is OK. While merging t this patch, Could you move "uint64_t aura_handle =3D 0;" just before "struct otx2_npa_lf *lf" as the variables are ordered in reverse xmas tree format in this file. With the above change: Acked-by: Jerin Jacob > size_t padding; > int rc; > > -- > 2.25.4 >