[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 05/12] target/i386: silence the compiler warnings in gen_shiftd_rm
From: |
Thomas Huth |
Subject: |
[PULL 05/12] target/i386: silence the compiler warnings in gen_shiftd_rm_T1 |
Date: |
Wed, 16 Dec 2020 18:29:42 +0100 |
From: Chen Qun <kuhn.chenqun@huawei.com>
The current "#ifdef TARGET_X86_64" statement affects
the compiler's determination of fall through.
When using -Wimplicit-fallthrough in our CFLAGS, the compiler showed warning:
target/i386/translate.c: In function ‘gen_shiftd_rm_T1’:
target/i386/translate.c:1773:12: warning: this statement may fall through
[-Wimplicit-fallthrough=]
if (is_right) {
^
target/i386/translate.c:1782:5: note: here
case MO_32:
^~~~
Reported-by: Euler Robot <euler.robot@huawei.com>
Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20201211152426.350966-6-thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
target/i386/translate.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/target/i386/translate.c b/target/i386/translate.c
index e8f5f5803a..25fec8a150 100644
--- a/target/i386/translate.c
+++ b/target/i386/translate.c
@@ -1777,9 +1777,12 @@ static void gen_shiftd_rm_T1(DisasContext *s, MemOp ot,
int op1,
} else {
tcg_gen_deposit_tl(s->T1, s->T0, s->T1, 16, 16);
}
- /* FALLTHRU */
-#ifdef TARGET_X86_64
+ /*
+ * If TARGET_X86_64 defined then fall through into MO_32 case,
+ * otherwise fall through default case.
+ */
case MO_32:
+#ifdef TARGET_X86_64
/* Concatenate the two 32-bit values and use a 64-bit shift. */
tcg_gen_subi_tl(s->tmp0, count, 1);
if (is_right) {
--
2.27.0
- [PULL 00/12] Compile QEMU with -Wimplicit-fallthrough, Thomas Huth, 2020/12/16
- [PULL 01/12] disas/libvixl: Fix fall-through annotation for GCC >= 7, Thomas Huth, 2020/12/16
- [PULL 02/12] target/unicore32/translate: Add missing fallthrough annotations, Thomas Huth, 2020/12/16
- [PULL 03/12] hw/rtc/twl92230: Silence warnings about missing fallthrough statements, Thomas Huth, 2020/12/16
- [PULL 04/12] hw/timer/renesas_tmr: silence the compiler warnings, Thomas Huth, 2020/12/16
- [PULL 05/12] target/i386: silence the compiler warnings in gen_shiftd_rm_T1,
Thomas Huth <=
- [PULL 06/12] hw/intc/arm_gicv3_kvm: silence the compiler warnings, Thomas Huth, 2020/12/16
- [PULL 09/12] target/sparc/win_helper: silence the compiler warnings, Thomas Huth, 2020/12/16
- [PULL 07/12] accel/tcg/user-exec: silence the compiler warnings, Thomas Huth, 2020/12/16
- [PULL 11/12] tests/fp: Do not emit implicit-fallthrough warnings in the softfloat tests, Thomas Huth, 2020/12/16
- [PULL 12/12] configure: Compile with -Wimplicit-fallthrough=2, Thomas Huth, 2020/12/16
- [PULL 10/12] tcg/optimize: Add fallthrough annotations, Thomas Huth, 2020/12/16
- [PULL 08/12] target/sparc/translate: silence the compiler warnings, Thomas Huth, 2020/12/16
- Re: [PULL 00/12] Compile QEMU with -Wimplicit-fallthrough, no-reply, 2020/12/16
- Re: [PULL 00/12] Compile QEMU with -Wimplicit-fallthrough, Peter Maydell, 2020/12/17