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.au...@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.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.
>>> When is -Wmaybe-uninitialized used? QEMU's build system doesn't set
>>> it. Unless it's automatically set by meson this must be a manual
>>> --extra-cflags= option you set.
>>
>> I am using this configure cmd line:
>>
>> ./configure --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib/qemu
>> --target-list=x86_64-softmmu --docdir=/usr/share/doc/qemu --enable-kvm
>> --extra-cflags=-O --enable-trace-backends=log --python=/usr/bin/python3
>> --extra-cflags=-Wall --extra-cflags=-Wundef
>> --extra-cflags=-Wwrite-strings --extra-cflags=-Wmissing-prototypes
>> --extra-cflags=-fno-strict-aliasing --extra-cflags=-fno-common
>> --extra-cflags=-Werror=type-limits
>>>
>>> If you added it manually then let's fix this in 8.0 since it's not
>>> tested/supported and very few people will see this issue.
> Please include the relevant meson output in the commit description, i.e.:
>
> C compiler for the host machine: clang (clang 14.0.0 "Apple clang
> version 14.0.0 (clang-1400.0.29.202)")
> C linker for the host machine: clang ld64 820.1
>
> Compilation
> host CPU : aarch64
> host endianness : little
> C compiler : clang
> Host C compiler : clang
> C++ compiler : c++
> Objective-C compiler : clang
> CFLAGS : -ggdb
> -Werror=incompatible-function-pointer-types -O2 -g
> CXXFLAGS : -ggdb
> -Werror=incompatible-function-pointer-types -O2 -g
> OBJCFLAGS : -ggdb
> -Werror=incompatible-function-pointer-types -ggdb -O2 -g
> LDFLAGS : -ggdb
> -Werror=incompatible-function-pointer-types
> QEMU_CFLAGS : ...
> QEMU_CXXFLAGS : ...
> QEMU_OBJCFLAGS : ...
> QEMU_LDFLAGS : -fstack-protector-strong
Here is the data:
C compiler for the host machine: cc -m64 -mcx16 (gcc 11.3.1 "cc (GCC)
11.3.1 20220421 (Red Hat 11.3.1-2)")
C linker for the host machine: cc -m64 -mcx16 ld.bfd 2.35.2-24
Compilation
host CPU : x86_64
host endianness : little
C compiler : cc -m64 -mcx16
Host C compiler : cc -m64 -mcx16
C++ compiler : c++ -m64 -mcx16
CFLAGS : -O -Wall -Wundef -Wwrite-strings
-Wmissing-prototypes -fno-strict-aliasing -fno-common
-Werror=type-limits -O2 -g
CXXFLAGS : -O -Wall -Wundef -Wwrite-strings
-Wmissing-prototypes -fno-strict-aliasing -fno-common
-Werror=type-limits -O2 -g
LDFLAGS : -O -Wall -Wundef -Wwrite-strings
-Wmissing-prototypes -fno-strict-aliasing -fno-common -Werror=type-limits
QEMU_CFLAGS : -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2
-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
-Wstrict-prototypes -Wredundant-decls -Wundef -Wwrite-strings
-Wmissing-prototypes -fno-strict-aliasing -fno-common -fwrapv
-Wold-style-declaration -Wold-style-definition -Wtype-limits
-Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers
-Wempty-body -Wnested-externs -Wendif-labels -Wexpansion-to-defined
-Wimplicit-fallthrough=2 -Wno-missing-include-dirs
-Wno-shift-negative-value -Wno-psabi -fstack-protector-strong
QEMU_CXXFLAGS : -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2
-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wundef
-Wwrite-strings -fno-strict-aliasing -fno-common -fwrapv -Wtype-limits
-Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers
-Wempty-body -Wendif-labels -Wexpansion-to-defined
-Wimplicit-fallthrough=2 -Wno-missing-include-dirs
-Wno-shift-negative-value -Wno-psabi -fstack-protector-strong
QEMU_OBJCFLAGS :
QEMU_LDFLAGS : -fstack-protector-strong -Wl,-z,relro
-Wl,-z,now
Eric
>
> Thanks,
>
> Phil.
>