Re: [PATCH tip/core/rcu 9/9] rcu: Suppress levelspread uninitialized messages

From: Geert Uytterhoeven
Date: Thu Oct 03 2019 - 04:53:17 EST


Hi Paul,

On Thu, Oct 3, 2019 at 3:49 AM <paulmck@xxxxxxxxxx> wrote:
> From: "Paul E. McKenney" <paulmck@xxxxxxxxxx>
>
> New tools bring new warnings, and with v5.3 comes:

According to the kisskb build logs, it happens with gcc 4.6.3 only ;-)

> kernel/rcu/srcutree.c: warning: 'levelspread[<U aa0>]' may be used uninitialized in this function [-Wuninitialized]: => 121:34
>
> This commit suppresses this warning by initializing the full array
> to INT_MIN, which will result in failures should any out-of-bounds
> references appear.
>
> Reported-by: Michael Ellerman <mpe@xxxxxxxxxxxxxx>
> Reported-by: Geert Uytterhoeven <geert@xxxxxxxxxxxxxx>
> Signed-off-by: Paul E. McKenney <paulmck@xxxxxxxxxx>

Thanks for your patch!

Reviewed-by: Geert Uytterhoeven <geert@xxxxxxxxxxxxxx>
(for the initialization loop, not for the actual INT_MIN value)

Unfortunately I don't have a gcc-4.6.3 Linux cross-compiler anymore.
I tried with msp430-gcc-4.6.3 and some hackery to get it to compile,
but that didn't let me reproduce the warning.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds