On Thu, Jan 8, 2026 at 7:01 PM Stephen Hemminger
<[email protected]> wrote:
>
> On Thu, 8 Jan 2026 16:19:37 -0500
> Scott Mitchell <[email protected]> wrote:
>
> > On Thu, Jan 8, 2026 at 11:12 AM Stephen Hemminger
> > <[email protected]> wrote:
> > >
> > > On Thu,  8 Jan 2026 01:13:38 -0500
> > > [email protected] wrote:
> > >
> > > > +#ifdef RTE_CC_GCC
> > > > +     /* Suppress GCC -Wmaybe-uninitialized false positive. No 
> > > > assembly/runtime impacts. */
> > > > +     asm volatile("" : "+m" (psd_hdr));
> > > > +#endif
> > > >
> > >
> > > Maybe rte_compiler_barrier() will do same thing?
> >
> > Agreed it feels like a compiler bug but looking for advice if I'm
> > missing something :)
> >
> > My initial concern with rte_compiler_barrier is its a general barrier
> > which may have broader impacts on
> > optimizations and compiled code. Will that be an issue in this case? I
> > wasn't sure and the approach
> > in the patch is targeted at a specific variable and assembly from
> > clang/gcc was the same. I will
> > introduce a macro to make it cleaner and I can replace it with
> > rte_compiler_barrier if preferred.
>
> Maybe try with -fanalyzer and it might tell you more.
> I suspect some of the aliasing setting are causing issues.
> Some drivers are turning on no-strict-aliasing

I have more evidence this is a GCC optimizer bug.
The RTE_SUPPRESS_UNINITIALIZED_WARNING approach serves
as a workaround to avoid the bug. I created a more minimal reproducer:
https://gist.github.com/Scottmitch/bf23748b4588e68c9bdb8d124f92f1bd

Your suspicion was correct, -fno-strict-aliasing avoids the bug but I don't
think it is desirable to enable this broadly for DPDK when we have a
more targeted workaround.

I will reach out to RH to confirm but in the interim I suggest we keep
RTE_SUPPRESS_UNINITIALIZED_WARNING (or similar alternative).

Reply via email to