From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id D048C11DE for ; Mon, 11 Jul 2016 04:53:59 +0200 (CEST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga102.fm.intel.com with ESMTP; 10 Jul 2016 19:53:58 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,344,1464678000"; d="scan'208";a="1014292797" Received: from yliu-dev.sh.intel.com (HELO yliu-dev) ([10.239.67.162]) by orsmga002.jf.intel.com with ESMTP; 10 Jul 2016 19:53:58 -0700 Date: Mon, 11 Jul 2016 10:56:20 +0800 From: Yuanhan Liu To: Ferruh Yigit Cc: dev@dpdk.org, Huawei Xie Message-ID: <20160711025620.GV26521@yliu-dev.sh.intel.com> References: <1467899348-31998-1-git-send-email-ferruh.yigit@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1467899348-31998-1-git-send-email-ferruh.yigit@intel.com> User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [dpdk-dev] [PATCH] net/virtio: fix gcc6 i686 compiler error X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jul 2016 02:54:00 -0000 On Thu, Jul 07, 2016 at 02:49:08PM +0100, Ferruh Yigit wrote: > This is for target i686-native-linuxapp-gcc and gcc6, > > Compilation error is: > == Build drivers/net/virtio > CC virtio_rxtx_simple.o > In file included from > .../build/include/rte_mempool.h:77:0, > from > .../drivers/net/virtio/virtio_rxtx_simple.c:46: > .../drivers/net/virtio/virtio_rxtx_simple.c: In > function ‘virtio_xmit_pkts_simple’: > .../build/include/rte_memcpy.h:551:2: error: array > subscript is above array bounds [-Werror=array-bounds] > rte_mov16((uint8_t *)dst + 1 * 16, (const uint8_t *)src + 1 * 16); > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > ... > > The compiler traces the array all through the call stack and knows the > size of array is 128 and generates a warning on above [1] which tries to > access beyond byte 128. > But unfortunately it ignores the "(size > 256)" check. > > Giving a hint to compiler that variable "size" is related to the size of > the source buffer fixes compiler warning. > > Fixes: 863bfb474493 ("mempool: optimize copy in cache") > > Signed-off-by: Ferruh Yigit Applied to dpdk-next-virtio. Thanks. --yliu