Re: [PATCH v12 3/3] eal/net: add workaround for GCC optimization bug

Scott Mitchell
2026-01-11T20:24:42Z

> I wonder if some of the magic types in rte_memcpy() [1] could be used to fix the aliasing/eliding problem in the checksum function:
>
> struct __rte_packed_begin rte_unaligned_uint16_alias {
> unaligned_uint16_t val;
> } __rte_packed_end __rte_may_alias;
>
>
> [1]: https://elixir.bootlin.com/dpdk/v25.11/source/lib/eal/x86/include/rte_memcpy.h#L66

Nice tip! clang/gcc optimize this (https://godbolt.org/z/WxjEbj6s4) and my
reproducer doesn't trigger the gcc bug. v13 coming soon.