On Mon, Nov 30, 2026 at 01:29:30PM +0100, Robin Jarry wrote:
> GCC 14 and 16 at -O0 report -Wstringop-overread when an inlined
> ring enqueue receives a 24-byte item. Without optimization, GCC
> diagnoses the 32-byte memcpy in the unreachable 128-bit copy path.
> The unoptimized-build warning flag does not apply to applications
> compiling DPDK headers, and the header-local suppression is gone.
>
> Copy the pair as two 16-byte elements instead. This avoids the
> false warning without suppressing diagnostics for applications.
> Optimized x86-64 code still uses two 16-byte loads and stores.
>
> Fixes: 812a18c167f4 ("build: disable GCC string op warnings when unoptimized")
> Cc: [email protected]
> Signed-off-by: Robin Jarry <[email protected]>
> ---
> lib/ring/rte_ring_elem_pvt.h | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
Forgive my ignorance here, but is this solving the underlying issue or just
tweaking the code to hide the warning. Given a 24-byte object, is two
16-byte copies not just as bad as a single 32-byte copies?
/Bruce
PS: AI analysis and testing of this patch also flags that when compiled for an
architecture with AVX2 available, the original code produces one 32-byte
load-store, vs two 16-byte load-stores for the updated code. Therefore,
there is potential for a regression here for any cases where we may be load
or store bounded.