Skip to contentSkip to conversation

target/mips: Fixes for 4.1 rc1

PATCH Superseded Aleksandar Markovic 1 participant 5 messages Jul 12, 2019

v2 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

v2 cover target/mips: Fixes for 4.1 rc1

From: Aleksandar Markovic <[email protected]>

At the moment, this includes fixes for problems in switch statements found by GCC 8.3 improved code analysis features.

v1->v2:

- excluded the patch on "ucontext" that will go into linux user queue

Aleksandar Markovic (4):
target/mips: Add 'fall through' comments for handling nanoMips' SHXS,
SWXS
target/mips: Add missing 'break' for a case of MTHC0 handling target/mips: Add missing 'break' for certain cases of MFTR handling target/mips: Add missing 'break' for certain cases of MTTR handling

 target/mips/translate.c | 7 +++++++
 1 file changed, 7 insertions(+)
Signature · 1 line
2.7.4
#1 lore raw

PATCH v2 1/4 target/mips: Add 'fall through' comments for handling nanoMips' SHXS, SWXS

From: Aleksandar Markovic <[email protected]>

This was found by GCC 8.3 static analysis.

---
 target/mips/translate.c | 2 ++
 1 file changed, 2 insertions(+)
target/mips/translate.c +2 -0
index f96f141..2be5e2d 100644
@@ -20136,12 +20136,14 @@ static void gen_p_lsx(DisasContext *ctx, int rd, int rs, int rt)
         switch (extract32(ctx->opcode, 7, 4)) {
         case NM_SHXS:
             check_nms(ctx);
+            /* fall through */
         case NM_LHXS:
         case NM_LHUXS:
             tcg_gen_shli_tl(t0, t0, 1);
             break;
         case NM_SWXS:
             check_nms(ctx);
+            /* fall through */
         case NM_LWXS:
         case NM_LWC1XS:
         case NM_SWC1XS:
Signature · 1 line
2.7.4
#2 lore raw

PATCH v2 2/4 target/mips: Add missing 'break' for a case of MTHC0 handling

In reply to Aleksandar Markovic

From: Aleksandar Markovic <[email protected]>

This was found by GCC 8.3 static analysis.

---
 target/mips/translate.c | 1 +
 1 file changed, 1 insertion(+)
target/mips/translate.c +1 -0
index 2be5e2d..59d4acd 100644
@@ -6745,6 +6745,7 @@ static void gen_mthc0(DisasContext *ctx, TCGv arg, int reg, int sel)
         default:
             goto cp0_unimplemented;
         }
+        break;
     case CP0_REGISTER_17:
         switch (sel) {
         case 0:
Signature · 1 line
2.7.4
#3 lore raw

PATCH v2 3/4 target/mips: Add missing 'break' for certain cases of MFTR handling

In reply to Aleksandar Markovic

From: Aleksandar Markovic <[email protected]>

This was found by GCC 8.3 static analysis.

---
 target/mips/translate.c | 2 ++
 1 file changed, 2 insertions(+)
target/mips/translate.c +2 -0
index 59d4acd..b1cf5f0 100644
@@ -9826,6 +9826,7 @@ static void gen_mftr(CPUMIPSState *env, DisasContext *ctx, int rt, int rd,
                 gen_mfc0(ctx, t0, rt, sel);
                 break;
             }
+            break;
         case 12:
             switch (sel) {
             case 0:
@@ -9835,6 +9836,7 @@ static void gen_mftr(CPUMIPSState *env, DisasContext *ctx, int rt, int rd,
                 gen_mfc0(ctx, t0, rt, sel);
                 break;
             }
+            break;
         case 13:
             switch (sel) {
             case 0:
Signature · 1 line
2.7.4
#4 lore raw

PATCH v2 4/4 target/mips: Add missing 'break' for certain cases of MTTR handling

In reply to Aleksandar Markovic

From: Aleksandar Markovic <[email protected]>

This was found by GCC 8.3 static analysis.

---
 target/mips/translate.c | 2 ++
 1 file changed, 2 insertions(+)
target/mips/translate.c +2 -0
index b1cf5f0..ca62800 100644
@@ -10055,6 +10055,7 @@ static void gen_mttr(CPUMIPSState *env, DisasContext *ctx, int rd, int rt,
                 gen_mtc0(ctx, t0, rd, sel);
                 break;
             }
+            break;
         case 12:
             switch (sel) {
             case 0:
@@ -10064,6 +10065,7 @@ static void gen_mttr(CPUMIPSState *env, DisasContext *ctx, int rd, int rt,
                 gen_mtc0(ctx, t0, rd, sel);
                 break;
             }
+            break;
         case 13:
             switch (sel) {
             case 0:
Signature · 1 line
2.7.4