Skip to contentSkip to conversation

eal/ppc: ignore gcc 10 stringop-overflow warnings

PATCH In review David Christensen 2 participants 7 messages Jun 23, 2021 – Sep 13, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 eal/ppc: ignore gcc 10 stringop-overflow warnings

Suppress gcc warning "warning: writing 16 bytes into a region of size 0" for users of the POWER rte_memcpy() function. Existing rte_memcpy() code takes different code paths based on the actual size of the move so the warning is already addressed. See also commit b5b3ea803e47 ("eal/x86: ignore gcc 10 stringop-overflow warnings")

---
 lib/eal/ppc/include/rte_memcpy.h | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
lib/eal/ppc/include/rte_memcpy.h +11 -2
index c2a1f356d5..a84893cf8e 100644
@@ -18,11 +18,16 @@ extern "C" {
 
 #include "generic/rte_memcpy.h"
 
-#if (GCC_VERSION >= 90000 && GCC_VERSION < 90400)
+#if defined(RTE_TOOLCHAIN_GCC) && (GCC_VERSION >= 90000)
 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Warray-bounds"
 #endif
 
+#if defined(RTE_TOOLCHAIN_GCC) && (GCC_VERSION >= 100000)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wstringop-overflow"
+#endif
+
 static inline void
 rte_mov16(uint8_t *dst, const uint8_t *src)
 {
@@ -198,7 +203,11 @@ rte_memcpy_func(void *dst, const void *src, size_t n)
 	return ret;
 }
 
-#if (GCC_VERSION >= 90000 && GCC_VERSION < 90400)
+#if defined(RTE_TOOLCHAIN_GCC) && (GCC_VERSION >= 100000)
+#pragma GCC diagnostic pop
+#endif
+
+#if defined(RTE_TOOLCHAIN_GCC) && (GCC_VERSION >= 90000)
 #pragma GCC diagnostic pop
 #endif
 
Signature · 1 line
2.27.0
#1 lore raw
Quoted 6 lines · David Christensen

Suppress gcc warning "warning: writing 16 bytes into a region of size 0" for users of the POWER rte_memcpy() function. Existing rte_memcpy() code takes different code paths based on the actual size of the move so the warning is already addressed. See also commit b5b3ea803e47 ("eal/x86: ignore gcc 10 stringop-overflow warnings")

Bugzilla ID: 739 ?

What about a Cc: [email protected]?
We did backport such change for x86.

Signature · 1 line
David Marchand
#2 lore raw
Quoted 10 lines · David Marchand
Quoted 6 lines · David Christensen

Suppress gcc warning "warning: writing 16 bytes into a region of size 0" for users of the POWER rte_memcpy() function. Existing rte_memcpy() code takes different code paths based on the actual size of the move so the warning is already addressed. See also commit b5b3ea803e47 ("eal/x86: ignore gcc 10 stringop-overflow warnings")

Bugzilla ID: 739 ?

Different compiler warning, though same gcc version involved.

Quoted 2 lines

What about a Cc: [email protected]?
We did backport such change for x86.

Yes, should apply to stable as well. Do I need to resubmit patch or is the CC: enough?

Dave

#3 lore raw
Quoted 12 lines · David Christensen
Quoted 9 lines · David Marchand
Quoted 6 lines · David Christensen

Suppress gcc warning "warning: writing 16 bytes into a region of size 0" for users of the POWER rte_memcpy() function.  Existing rte_memcpy() code takes different code paths based on the actual size of the move so the warning is already addressed. See also commit b5b3ea803e47 ("eal/x86: ignore gcc 10 stringop-overflow warnings")

Quoted 8 lines
Quoted 1 line

Bugzilla ID: 739 ?

Different compiler warning, though same gcc version involved.

Quoted 2 lines

What about a Cc: [email protected]?
We did backport such change for x86.

Yes, should apply to stable as well.  Do I need to resubmit patch or is the CC: enough?

Any reservations about including this in 21.08-rc3?

Dave

#4 lore raw

PATCH 1/1 eal/ppc: ignore gcc 10 stringop-overflow warnings

In reply to David Christensen

Suppress gcc warning "warning: writing 16 bytes into a region of size 0" for users of the POWER rte_memcpy() function. Existing rte_memcpy() code takes different code paths based on the actual size of the move so the warning is already addressed. See also commit b5b3ea803e47 ("eal/x86: ignore gcc 10 stringop-overflow warnings")

---
v2:
- update copyright year
- rebase for 21.11-rc0

---
 lib/eal/ppc/include/rte_memcpy.h | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)
lib/eal/ppc/include/rte_memcpy.h +12 -3
index c2a1f356d5..6f388c0234 100644
@@ -1,6 +1,6 @@
 /*
  * SPDX-License-Identifier: BSD-3-Clause
- * Copyright (C) IBM Corporation 2014.
+ * Copyright (C) IBM Corporation 2014,2021
  */
 
 #ifndef _RTE_MEMCPY_PPC_64_H_
@@ -18,11 +18,16 @@ extern "C" {
 
 #include "generic/rte_memcpy.h"
 
-#if (GCC_VERSION >= 90000 && GCC_VERSION < 90400)
+#if defined(RTE_TOOLCHAIN_GCC) && (GCC_VERSION >= 90000)
 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Warray-bounds"
 #endif
 
+#if defined(RTE_TOOLCHAIN_GCC) && (GCC_VERSION >= 100000)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wstringop-overflow"
+#endif
+
 static inline void
 rte_mov16(uint8_t *dst, const uint8_t *src)
 {
@@ -198,7 +203,11 @@ rte_memcpy_func(void *dst, const void *src, size_t n)
 	return ret;
 }
 
-#if (GCC_VERSION >= 90000 && GCC_VERSION < 90400)
+#if defined(RTE_TOOLCHAIN_GCC) && (GCC_VERSION >= 100000)
+#pragma GCC diagnostic pop
+#endif
+
+#if defined(RTE_TOOLCHAIN_GCC) && (GCC_VERSION >= 90000)
 #pragma GCC diagnostic pop
 #endif
 

--
2.27.0

#5 lore raw
Quoted 11 lines

Suppress gcc warning "warning: writing 16 bytes into a region of size 0" for users of the POWER rte_memcpy() function. Existing rte_memcpy() code takes different code paths based on the actual size of the move so the warning is already addressed. See also commit b5b3ea803e47 ("eal/x86: ignore gcc 10 stringop-overflow warnings")

---
v2:
- update copyright year
- rebase for 21.11-rc0

David M,

Any chance of getting this approved in the 21.11 cycle? Patch was originally submitted on 6/23, is only applicable to PPC architecture, and has no functional impact because it only disables warnings. Patchwork reports a performance test regression on x86 systems:

http://patches.dpdk.org/project/dpdk/patch/[email protected]/

But I don't see how that is possible. Applying the patch on a local x86 system results in identical x86 binaries with and without the patch applied. It would appear that the test-to-test performance variations exceed the failure threshold on the CI setup.

Dave

#6 lore raw
In reply to David Christensen
Quoted 7 lines · David Christensen

Suppress gcc warning "warning: writing 16 bytes into a region of size 0" for users of the POWER rte_memcpy() function. Existing rte_memcpy() code takes different code paths based on the actual size of the move so the warning is already addressed. See also commit b5b3ea803e47 ("eal/x86: ignore gcc 10 stringop-overflow warnings")

Quoted 1 line

Applied, thanks.

Signature · 1 line
David Marchand