eal/ppc: ignore gcc 10 stringop-overflow warnings

Message ID 20210623161246.49474-1-drc@linux.vnet.ibm.com (mailing list archive)
State Superseded, archived
Delegated to: David Marchand
Headers
Series eal/ppc: ignore gcc 10 stringop-overflow warnings |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/github-robot success github build: passed
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-testing success Testing PASS

Commit Message

David Christensen June 23, 2021, 4:12 p.m. UTC
  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")

Signed-off-by: David Christensen <drc@linux.vnet.ibm.com>
---
 lib/eal/ppc/include/rte_memcpy.h | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
  

Comments

David Marchand July 5, 2021, 9:28 a.m. UTC | #1
On Wed, Jun 23, 2021 at 6:13 PM David Christensen
<drc@linux.vnet.ibm.com> wrote:
>
> 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: stable@dpdk.org?
We did backport such change for x86.
  
David Christensen July 12, 2021, 7:35 p.m. UTC | #2
On 7/5/21 2:28 AM, David Marchand wrote:
> On Wed, Jun 23, 2021 at 6:13 PM David Christensen
> <drc@linux.vnet.ibm.com> wrote:
>>
>> 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.

> What about a Cc: stable@dpdk.org?
> 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
  
David Christensen July 28, 2021, 5:49 p.m. UTC | #3
On 7/12/21 12:35 PM, David Christensen wrote:
> 
> 
> On 7/5/21 2:28 AM, David Marchand wrote:
>> On Wed, Jun 23, 2021 at 6:13 PM David Christensen
>> <drc@linux.vnet.ibm.com> wrote:
>>>
>>> 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.
> 
>> What about a Cc: stable@dpdk.org?
>> 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
  

Patch

diff --git a/lib/eal/ppc/include/rte_memcpy.h b/lib/eal/ppc/include/rte_memcpy.h
index c2a1f356d5..a84893cf8e 100644
--- a/lib/eal/ppc/include/rte_memcpy.h
+++ b/lib/eal/ppc/include/rte_memcpy.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