On 12/7/22 14:24, Eric Auger wrote:
> Initialize r0-3 to avoid compilation errors when
> -Werror=maybe-uninitialized is used
>
> ../target/i386/ops_sse.h: In function ‘helper_vpermdq_ymm’:
> ../target/i386/ops_sse.h:2495:13: error: ‘r3’ may be used uninitialized in
> this function [-Werror=maybe-uninitialized]
> 2495 | d->Q(3) = r3;
> | ~~~~~~~~^~~~
> ../target/i386/ops_sse.h:2494:13: error: ‘r2’ may be used uninitialized in
> this function [-Werror=maybe-uninitialized]
> 2494 | d->Q(2) = r2;
> | ~~~~~~~~^~~~
> ../target/i386/ops_sse.h:2493:13: error: ‘r1’ may be used uninitialized in
> this function [-Werror=maybe-uninitialized]
> 2493 | d->Q(1) = r1;
> | ~~~~~~~~^~~~
> ../target/i386/ops_sse.h:2492:13: error: ‘r0’ may be used uninitialized in
> this function [-Werror=maybe-uninitialized]
> 2492 | d->Q(0) = r0;
> | ~~~~~~~~^~~~
>
> Signed-off-by: Eric Auger <eric.au...@redhat.com>
> Fixes: 790684776861 ("target/i386: reimplement 0x0f 0x3a, add AVX")
>
> ---
>
> Am I the only one getting this? Or anything wrong in my setup.
With Stefan's correct address. Forgive me for the noise.
Eric
> ---
> target/i386/ops_sse.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/target/i386/ops_sse.h b/target/i386/ops_sse.h
> index 3cbc36a59d..b77071b8da 100644
> --- a/target/i386/ops_sse.h
> +++ b/target/i386/ops_sse.h
> @@ -2451,7 +2451,7 @@ void glue(helper_vpgatherqq, SUFFIX)(CPUX86State *env,
> #if SHIFT >= 2
> void helper_vpermdq_ymm(Reg *d, Reg *v, Reg *s, uint32_t order)
> {
> - uint64_t r0, r1, r2, r3;
> + uint64_t r0 = 0, r1 = 0, r2 = 0, r3 = 0;
>
> switch (order & 3) {
> case 0: