]> xenbits.xensource.com Git - qemu-xen.git/commit
target/i386: Remove compilation errors when -Werror=maybe-uninitialized
authorEric Auger <eric.auger@redhat.com>
Thu, 22 Dec 2022 14:01:58 +0000 (15:01 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 11 Jan 2023 08:59:39 +0000 (09:59 +0100)
commitc0a6665c3c4d63b113ab31c624c53d4a32de2926
tree45a77a7bd437ad4e975c4b4bafb60256c50b1db6
parentf39b7d2b96e3e73c01bb678cd096f7baf0b9ab39
target/i386: Remove compilation errors when -Werror=maybe-uninitialized

To avoid compilation errors when -Werror=maybe-uninitialized is used,
add a default case with g_assert_not_reached().

Otherwise with GCC 11.3.1 "cc (GCC) 11.3.1 20220421 (Red Hat 11.3.1-2)"
we get:

../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>
Message-Id: <20221222140158.1260748-1-eric.auger@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
target/i386/ops_sse.h