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 5A131A04B2; Mon, 4 May 2020 19:45:59 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A64CC1D50C; Mon, 4 May 2020 19:45:58 +0200 (CEST) Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by dpdk.org (Postfix) with ESMTP id E6B441D50A for ; Mon, 4 May 2020 19:45:56 +0200 (CEST) Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 044HXYvR021222 for ; Mon, 4 May 2020 13:45:56 -0400 Received: from ppma04dal.us.ibm.com (7a.29.35a9.ip4.static.sl-reverse.com [169.53.41.122]) by mx0a-001b2d01.pphosted.com with ESMTP id 30s36b51pp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 04 May 2020 13:45:55 -0400 Received: from pps.filterd (ppma04dal.us.ibm.com [127.0.0.1]) by ppma04dal.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id 044HgoFo028728 for ; Mon, 4 May 2020 17:45:55 GMT Received: from b01cxnp22033.gho.pok.ibm.com (b01cxnp22033.gho.pok.ibm.com [9.57.198.23]) by ppma04dal.us.ibm.com with ESMTP id 30s0g6f3tf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 04 May 2020 17:45:55 +0000 Received: from b01ledav005.gho.pok.ibm.com (b01ledav005.gho.pok.ibm.com [9.57.199.110]) by b01cxnp22033.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 044HjstL48955814 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 4 May 2020 17:45:54 GMT Received: from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7244DAE060; Mon, 4 May 2020 17:45:54 +0000 (GMT) Received: from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 66323AE05F; Mon, 4 May 2020 17:45:54 +0000 (GMT) Received: from localhost.localdomain (unknown [9.114.224.51]) by b01ledav005.gho.pok.ibm.com (Postfix) with ESMTP; Mon, 4 May 2020 17:45:54 +0000 (GMT) From: David Christensen To: dev@dpdk.org Cc: David Christensen Date: Mon, 4 May 2020 10:45:52 -0700 Message-Id: <20200504174552.6700-1-drc@linux.vnet.ibm.com> X-Mailer: git-send-email 2.18.1 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.676 definitions=2020-05-04_11:2020-05-04, 2020-05-04 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 adultscore=0 bulkscore=0 priorityscore=1501 mlxscore=0 phishscore=0 clxscore=1015 malwarescore=0 suspectscore=0 spamscore=0 lowpriorityscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2005040140 Subject: [dpdk-dev] [PATCH] eal: fix rte_memcpy build on ppc with gcc 9.3 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" Building DPDK on Ubuntu 20.04 with GCC 9.3.0 results in a "subscript is outside array bounds" message in rte_memcpy function. The build error is caused by an interaction between __builtin_constant_p and "-Werror=array-bounds" as described in this bugzilla: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90387 Modify the code to disable the array-bounds check for GCC versions 9.0 to 9.3. Signed-off-by: David Christensen --- lib/librte_eal/ppc/include/rte_memcpy.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/librte_eal/ppc/include/rte_memcpy.h b/lib/librte_eal/ppc/include/rte_memcpy.h index 25311ba1d..dce173d4b 100644 --- a/lib/librte_eal/ppc/include/rte_memcpy.h +++ b/lib/librte_eal/ppc/include/rte_memcpy.h @@ -8,8 +8,7 @@ #include #include -/*To include altivec.h, GCC version must >= 4.8 */ -#include +#include "rte_altivec.h" #ifdef __cplusplus extern "C" { @@ -17,6 +16,11 @@ extern "C" { #include "generic/rte_memcpy.h" +#if (__GNUC__ == 9 && __GNUC_MINOR__ < 4) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Warray-bounds" +#endif + static inline void rte_mov16(uint8_t *dst, const uint8_t *src) { @@ -192,6 +196,10 @@ rte_memcpy_func(void *dst, const void *src, size_t n) return ret; } +#if (__GNUC__ == 9 && __GNUC_MINOR__ < 4) +#pragma GCC diagnostic pop +#endif + #ifdef __cplusplus } #endif -- 2.18.1