https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108968

--- Comment #9 from Andrew Cooper <andrew.cooper3 at citrix dot com> ---
Thank-you for the fix.

I've recompiled master and this uninitialised warning has gone.

Unfortunately, Xen isn't GCC-13 clean (seems like a real bug in Xen), and the
analyser has pointed out various other things which I'm still looking in to.  I
don't see anything which looks like it is a new knock-on effect from this
change.

Our code does fundamentally rely on get_cpu_info() always returning the same
pointer (on a single CPU).  For example, `current` is defined as
`get_cpu_info()->current` and we do expect that to yield the same pointer when
used multiple times.

Even if the analyser was interpreting the generated asm, there's no way it
could prove this without knowing the size/alignment constraints of our stacks.

Would a const annotation on get_cpu_info() be likely to help?  It occurs to me
that this is true in all cases that the compiler could legitimately reason
about.  (It would only cease being true if we fell off our stack, at which
point UB is the very least of our worries.)

Reply via email to