dcavalca / rpms / qemu

Forked from rpms/qemu a year ago
Clone

Blame 0059-tcg-mips-kill-warnings-in-user-mode.patch

5544c1
From e63a3c6c70c9933320c6d8b23c3ea4cf4724d316 Mon Sep 17 00:00:00 2001
5544c1
From: Aurelien Jarno <aurelien@aurel32.net>
5544c1
Date: Fri, 21 Sep 2012 18:20:25 +0200
5544c1
Subject: [PATCH] tcg/mips: kill warnings in user mode
5544c1
5544c1
Recent versions of GCC emit warnings when compiling user mode targets.
5544c1
Kill them by reordering a bit the #ifdef.
5544c1
5544c1
Reviewed-by: Richard Henderson <rth@twiddle.net>
5544c1
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
5544c1
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
5544c1
---
5544c1
 tcg/mips/tcg-target.c | 84 ++++++++++++++++++++++++++-------------------------
5544c1
 1 file changed, 43 insertions(+), 41 deletions(-)
5544c1
5544c1
diff --git a/tcg/mips/tcg-target.c b/tcg/mips/tcg-target.c
5544c1
index 9293745..a09c0d6 100644
5544c1
--- a/tcg/mips/tcg-target.c
5544c1
+++ b/tcg/mips/tcg-target.c
5544c1
@@ -842,18 +842,16 @@ static const void * const qemu_st_helpers[4] = {
5544c1
 static void tcg_out_qemu_ld(TCGContext *s, const TCGArg *args,
5544c1
                             int opc)
5544c1
 {
5544c1
-    int addr_regl, addr_meml;
5544c1
-    int data_regl, data_regh, data_reg1, data_reg2;
5544c1
-    int mem_index, s_bits;
5544c1
+    int addr_regl, data_regl, data_regh, data_reg1, data_reg2;
5544c1
 #if defined(CONFIG_SOFTMMU)
5544c1
     void *label1_ptr, *label2_ptr;
5544c1
     int arg_num;
5544c1
-#endif
5544c1
-#if TARGET_LONG_BITS == 64
5544c1
-# if defined(CONFIG_SOFTMMU)
5544c1
+    int mem_index, s_bits;
5544c1
+    int addr_meml;
5544c1
+# if TARGET_LONG_BITS == 64
5544c1
     uint8_t *label3_ptr;
5544c1
-# endif
5544c1
     int addr_regh, addr_memh;
5544c1
+# endif
5544c1
 #endif
5544c1
     data_regl = *args++;
5544c1
     if (opc == 3)
5544c1
@@ -861,11 +859,22 @@ static void tcg_out_qemu_ld(TCGContext *s, const TCGArg *args,
5544c1
     else
5544c1
         data_regh = 0;
5544c1
     addr_regl = *args++;
5544c1
-#if TARGET_LONG_BITS == 64
5544c1
+#if defined(CONFIG_SOFTMMU)
5544c1
+# if TARGET_LONG_BITS == 64
5544c1
     addr_regh = *args++;
5544c1
-#endif
5544c1
+#  if defined(TCG_TARGET_WORDS_BIGENDIAN)
5544c1
+    addr_memh = 0;
5544c1
+    addr_meml = 4;
5544c1
+#  else
5544c1
+    addr_memh = 4;
5544c1
+    addr_meml = 0;
5544c1
+#  endif
5544c1
+# else
5544c1
+    addr_meml = 0;
5544c1
+# endif
5544c1
     mem_index = *args;
5544c1
     s_bits = opc & 3;
5544c1
+#endif
5544c1
 
5544c1
     if (opc == 3) {
5544c1
 #if defined(TCG_TARGET_WORDS_BIGENDIAN)
5544c1
@@ -879,18 +888,6 @@ static void tcg_out_qemu_ld(TCGContext *s, const TCGArg *args,
5544c1
         data_reg1 = data_regl;
5544c1
         data_reg2 = 0;
5544c1
     }
5544c1
-#if TARGET_LONG_BITS == 64
5544c1
-# if defined(TCG_TARGET_WORDS_BIGENDIAN)
5544c1
-    addr_memh = 0;
5544c1
-    addr_meml = 4;
5544c1
-# else
5544c1
-    addr_memh = 4;
5544c1
-    addr_meml = 0;
5544c1
-# endif
5544c1
-#else
5544c1
-    addr_meml = 0;
5544c1
-#endif
5544c1
-
5544c1
 #if defined(CONFIG_SOFTMMU)
5544c1
     tcg_out_opc_sa(s, OPC_SRL, TCG_REG_A0, addr_regl, TARGET_PAGE_BITS - CPU_TLB_ENTRY_BITS);
5544c1
     tcg_out_opc_imm(s, OPC_ANDI, TCG_REG_A0, TCG_REG_A0, (CPU_TLB_SIZE - 1) << CPU_TLB_ENTRY_BITS);
5544c1
@@ -1029,50 +1026,55 @@ static void tcg_out_qemu_ld(TCGContext *s, const TCGArg *args,
5544c1
 static void tcg_out_qemu_st(TCGContext *s, const TCGArg *args,
5544c1
                             int opc)
5544c1
 {
5544c1
-    int addr_regl, addr_meml;
5544c1
-    int data_regl, data_regh, data_reg1, data_reg2;
5544c1
-    int mem_index, s_bits;
5544c1
+    int addr_regl, data_regl, data_regh, data_reg1, data_reg2;
5544c1
 #if defined(CONFIG_SOFTMMU)
5544c1
     uint8_t *label1_ptr, *label2_ptr;
5544c1
     int arg_num;
5544c1
+    int mem_index, s_bits;
5544c1
+    int addr_meml;
5544c1
 #endif
5544c1
 #if TARGET_LONG_BITS == 64
5544c1
 # if defined(CONFIG_SOFTMMU)
5544c1
     uint8_t *label3_ptr;
5544c1
-# endif
5544c1
     int addr_regh, addr_memh;
5544c1
+# endif
5544c1
 #endif
5544c1
-
5544c1
     data_regl = *args++;
5544c1
     if (opc == 3) {
5544c1
         data_regh = *args++;
5544c1
-#if defined(TCG_TARGET_WORDS_BIGENDIAN)
5544c1
-        data_reg1 = data_regh;
5544c1
-        data_reg2 = data_regl;
5544c1
-#else
5544c1
-        data_reg1 = data_regl;
5544c1
-        data_reg2 = data_regh;
5544c1
-#endif
5544c1
     } else {
5544c1
-        data_reg1 = data_regl;
5544c1
-        data_reg2 = 0;
5544c1
         data_regh = 0;
5544c1
     }
5544c1
     addr_regl = *args++;
5544c1
-#if TARGET_LONG_BITS == 64
5544c1
+#if defined(CONFIG_SOFTMMU)
5544c1
+# if TARGET_LONG_BITS == 64
5544c1
     addr_regh = *args++;
5544c1
-# if defined(TCG_TARGET_WORDS_BIGENDIAN)
5544c1
+#  if defined(TCG_TARGET_WORDS_BIGENDIAN)
5544c1
     addr_memh = 0;
5544c1
     addr_meml = 4;
5544c1
-# else
5544c1
+#  else
5544c1
     addr_memh = 4;
5544c1
     addr_meml = 0;
5544c1
-# endif
5544c1
-#else
5544c1
+#  endif
5544c1
+# else
5544c1
     addr_meml = 0;
5544c1
-#endif
5544c1
+# endif
5544c1
     mem_index = *args;
5544c1
     s_bits = opc;
5544c1
+#endif
5544c1
+
5544c1
+    if (opc == 3) {
5544c1
+#if defined(TCG_TARGET_WORDS_BIGENDIAN)
5544c1
+        data_reg1 = data_regh;
5544c1
+        data_reg2 = data_regl;
5544c1
+#else
5544c1
+        data_reg1 = data_regl;
5544c1
+        data_reg2 = data_regh;
5544c1
+#endif
5544c1
+    } else {
5544c1
+        data_reg1 = data_regl;
5544c1
+        data_reg2 = 0;
5544c1
+    }
5544c1
 
5544c1
 #if defined(CONFIG_SOFTMMU)
5544c1
     tcg_out_opc_sa(s, OPC_SRL, TCG_REG_A0, addr_regl, TARGET_PAGE_BITS - CPU_TLB_ENTRY_BITS);
5544c1
-- 
5544c1
1.7.12.1
5544c1