qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH for 7.2?] target/i386: Remove compilation errors when -Werror


From: Eric Auger
Subject: Re: [PATCH for 7.2?] target/i386: Remove compilation errors when -Werror=maybe-uninitialized
Date: Wed, 7 Dec 2022 21:11:52 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.1

Hi Stefan,

On 12/7/22 20:59, Stefan Hajnoczi wrote:
> On Wed, 7 Dec 2022 at 14:11, Stefan Weil <sw@weilnetz.de> wrote:
>> Am 07.12.22 um 19:22 schrieb Eric Auger:
>>> On 12/7/22 17:55, Philippe Mathieu-Daudé wrote:
>>>> On 7/12/22 15:33, Eric Auger wrote:
>>>>> On 12/7/22 15:09, Stefan Hajnoczi wrote:
>>>>>> On Wed, 7 Dec 2022 at 08:31, Eric Auger <eric.auger@redhat.com> wrote:
>>>>>>> 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.auger@redhat.com>
>>>>>>>> Fixes: 790684776861 ("target/i386: reimplement 0x0f 0x3a, add AVX")
>>>>>>>>
>>>>>>>> ---
>>>>>>>>
>>>>>>>> Am I the only one getting this? Or anything wrong in my setup.
>> Hi Eric,
>>
>> no, you are not the only one. I regularly build with higher warning
>> levels, for example with -Weverything on macOS, and get a much longer
>> list which includes the mentioned warnings (see below).
>>
>> The warnings for ops_sse.h are false positives, so I think no fix is
>> needed for 7.2. The compiler is not clever enough to see that the switch
>> statements handle all possible cases. It should be sufficient to replace
>> `case 3` by `default` to help the compiler and fix the warning. Your fix
>> might produce new compiler warnings because setting the variables to 0
>> has no effect.
> Eric: do you want to try the switch "default" approach for 8.0?

Yes sure!

Eric
>
> Thanks,
> Stefan
>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]