From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yuanhan Liu Subject: Re: [PATCH] net/virtio: fix gcc6 i686 compiler error Date: Mon, 11 Jul 2016 10:56:20 +0800 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-Transfer-Encoding: quoted-printable Cc: dev@dpdk.org, Huawei Xie To: Ferruh Yigit 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) Content-Disposition: inline In-Reply-To: <1467899348-31998-1-git-send-email-ferruh.yigit@intel.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Thu, Jul 07, 2016 at 02:49:08PM +0100, Ferruh Yigit wrote: > This is for target i686-native-linuxapp-gcc and gcc6, >=20 > Compilation error is: > =3D=3D 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 =E2=80=98virtio_xmit_pkts_simple=E2=80=99: > .../build/include/rte_memcpy.h:551:2: error: array > subscript is above array bounds [-Werror=3Darray-bounds] > rte_mov16((uint8_t *)dst + 1 * 16, (const uint8_t *)src + 1 * 16); > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >=20 ... >=20 > 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 t= o > access beyond byte 128. > But unfortunately it ignores the "(size > 256)" check. >=20 > Giving a hint to compiler that variable "size" is related to the size o= f > the source buffer fixes compiler warning. >=20 > Fixes: 863bfb474493 ("mempool: optimize copy in cache") >=20 > Signed-off-by: Ferruh Yigit Applied to dpdk-next-virtio. Thanks. --yliu