From: Jerin Jacob <jerinjacobk@gmail.com>
To: Ferruh Yigit <ferruh.yigit@intel.com>
Cc: Jerin Jacob <jerinj@marvell.com>,
Nithin Dabilpuram <ndabilpuram@marvell.com>,
dpdk-dev <dev@dpdk.org>, Thomas Monjalon <thomas@monjalon.net>,
David Marchand <david.marchand@redhat.com>
Subject: Re: [dpdk-dev] [PATCH v2 2/4] mempool/octeontx2: fix build for gcc O1 optimization
Date: Sun, 10 May 2020 17:21:13 +0530 [thread overview]
Message-ID: <CALBAE1MJrkWmZycUcfCdKkjHEA0_ei8iWeqy=TD53CWC92zmDw@mail.gmail.com> (raw)
In-Reply-To: <20200508164546.2489396-2-ferruh.yigit@intel.com>
On Fri, May 8, 2020 at 10:16 PM Ferruh Yigit <ferruh.yigit@intel.com> wrote:
>
> 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 <ferruh.yigit@intel.com>
> ---
> 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;
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 = 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 <jerinj@marvell.com>
> size_t padding;
> int rc;
>
> --
> 2.25.4
>
next prev parent reply other threads:[~2020-05-10 11:51 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-07 12:02 [dpdk-dev] [PATCH 1/3] ring: " Ferruh Yigit
2020-05-07 12:02 ` [dpdk-dev] [PATCH 2/3] mempool/octeontx2: " Ferruh Yigit
2020-05-07 14:05 ` Ananyev, Konstantin
2020-05-08 16:20 ` Ferruh Yigit
2020-05-08 16:39 ` Ferruh Yigit
2020-05-07 12:02 ` [dpdk-dev] [PATCH 3/3] net/ena: fix build for " Ferruh Yigit
2020-05-08 13:59 ` Michał Krawczyk
2020-05-07 13:47 ` [dpdk-dev] [PATCH 1/3] ring: fix build for gcc " Ananyev, Konstantin
2020-05-08 16:45 ` [dpdk-dev] [PATCH v2 1/4] " Ferruh Yigit
2020-05-08 16:45 ` [dpdk-dev] [PATCH v2 2/4] mempool/octeontx2: " Ferruh Yigit
2020-05-10 11:51 ` Jerin Jacob [this message]
2020-05-08 16:45 ` [dpdk-dev] [PATCH v2 3/4] net/ena: fix build for " Ferruh Yigit
2020-05-08 16:45 ` [dpdk-dev] [PATCH v2 4/4] event/octeontx2: " Ferruh Yigit
2020-05-08 17:22 ` Ananyev, Konstantin
2020-05-10 11:53 ` Jerin Jacob
2020-05-11 16:07 ` [dpdk-dev] [PATCH v3 1/4] ring: fix build for gcc " Ferruh Yigit
2020-05-11 16:07 ` [dpdk-dev] [PATCH v3 2/4] mempool/octeontx2: " Ferruh Yigit
2020-05-11 16:07 ` [dpdk-dev] [PATCH v3 3/4] net/ena: fix build for " Ferruh Yigit
2020-05-11 16:07 ` [dpdk-dev] [PATCH v3 4/4] event/octeontx2: " Ferruh Yigit
2020-05-11 19:13 ` [dpdk-dev] [PATCH v3 1/4] ring: fix build for gcc " Thomas Monjalon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CALBAE1MJrkWmZycUcfCdKkjHEA0_ei8iWeqy=TD53CWC92zmDw@mail.gmail.com' \
--to=jerinjacobk@gmail.com \
--cc=david.marchand@redhat.com \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@intel.com \
--cc=jerinj@marvell.com \
--cc=ndabilpuram@marvell.com \
--cc=thomas@monjalon.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).