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

Scott Mitchell scott.k.mitch1 at gmail.com
Sun Jan 11 21:24:28 CET 2026


> 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.


More information about the dev mailing list