From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jerin Jacob Subject: Re: [PATCH] net/thunderx: fix build with gcc optimization on Date: Tue, 26 Jun 2018 15:22:11 +0530 Message-ID: <20180626095208.GA7633@jerin> References: <20180621181450.91425-1-ferruh.yigit@intel.com> <20180624121723.GA7776@jerin> <609412c8-26c2-5263-5f6d-7e888228b885@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: Maciej Czekaj , dev@dpdk.org, stable@dpdk.org To: Ferruh Yigit Return-path: Content-Disposition: inline In-Reply-To: <609412c8-26c2-5263-5f6d-7e888228b885@intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" -----Original Message----- > Date: Tue, 26 Jun 2018 10:17:14 +0100 > From: Ferruh Yigit > To: Jerin Jacob > CC: Maciej Czekaj , dev@dpdk.org, > stable@dpdk.org > Subject: Re: [dpdk-dev] [PATCH] net/thunderx: fix build with gcc > optimization on > User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 > Thunderbird/52.8.0 > > > On 6/24/2018 1:17 PM, Jerin Jacob wrote: > > -----Original Message----- > >> Date: Thu, 21 Jun 2018 19:14:50 +0100 > >> From: Ferruh Yigit > >> To: Jerin Jacob , Maciej Czekaj > >> > >> CC: dev@dpdk.org, Ferruh Yigit , stable@dpdk.org > >> Subject: [PATCH] net/thunderx: fix build with gcc optimization on > >> X-Mailer: git-send-email 2.17.1 > >> > >> > >> build error gcc version 6.3.1 20161221 (Red Hat 6.3.1-1), > >> with EXTRA_CFLAGS="-O3": > >> > >> .../drivers/net/thunderx/nicvf_ethdev.c:907:9: > >> error: ‘txq’ may be used uninitialized in this function > >> [-Werror=maybe-uninitialized] > >> if (txq->pool_free == nicvf_single_pool_free_xmited_buffers) > >> ~~~^~~~~~~~~~~ > >> .../drivers/net/thunderx/nicvf_ethdev.c:886:20: > >> note: ‘txq’ was declared here > >> struct nicvf_txq *txq; > >> ^~~ > >> > >> Same error on function 'nicvf_eth_dev_init' and 'nicvf_dev_start', it > >> seems 'nicvf_set_tx_function' inlined when optimization enabled. > >> > >> Initialize the txq and add NULL check before using it to fix. > >> > >> Fixes: 7413feee662d ("net/thunderx: add device start/stop and close") > >> Cc: stable@dpdk.org > >> > >> Reported-by: Richard Walsh > >> Signed-off-by: Ferruh Yigit > > > > Acked-by: Jerin Jacob > > > >> --- > >> > >> Btw, no compiler optimization enabled, only nicvf_rxtx.c has -Ofast, > >> is this intentional? > > > > Yes. At least in our setup, -Ofast turns out to be super set of -O3. > > That is what gcc documents about -Ofast, but again it is only for single > nicvf_rxtx.c file. The problem seen with -O3 case with other file. OK. For other files, we intentionally kept non -03 as it is in slow path. >