Skip to contentSkip to conversation

ppc: Fix use of uninitialized TCG variable in tlbiva

PATCH Applied Andreas Färber 3 participants 4 messages Dec 7, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ppc: Fix use of uninitialized TCG variable in tlbiva

Silences a warning about possible unitialized use of t0.

The remaining ca. three warnings seemed to be due to GCC's dumbness to not recognize identical conditions.

---
Making the add_ca argument const did not resolve the warning for t1 in gen_op_arith_{add,subf}.

target-ppc/translate.c +1 -1
index 31d7387..a239ebd 100644
@@ -5381,11 +5381,11 @@ GEN_HANDLER(tlbiva, 0x1F, 0x12, 0x18, 0x03FFF801, PPC_TLBIVA)
 #if defined(CONFIG_USER_ONLY)
     GEN_EXCP_PRIVOPC(ctx);
 #else
-    TCGv t0;
     if (unlikely(!ctx->supervisor)) {
         GEN_EXCP_PRIVOPC(ctx);
         return;
     }
+    TCGv t0 = tcg_temp_new();
     gen_addr_reg_index(t0, ctx);
 #if defined(TARGET_PPC64)
     if (!ctx->sf_mode)
target-ppc/translate.c +1 -1
index 31d7387..a239ebd 100644
@@ -5381,11 +5381,11 @@ GEN_HANDLER(tlbiva, 0x1F, 0x12, 0x18, 0x03FFF801, PPC_TLBIVA)
 #if defined(CONFIG_USER_ONLY)
     GEN_EXCP_PRIVOPC(ctx);
 #else
-    TCGv t0;
     if (unlikely(!ctx->supervisor)) {
         GEN_EXCP_PRIVOPC(ctx);
         return;
     }
+    TCGv t0 = tcg_temp_new();
     gen_addr_reg_index(t0, ctx);
 #if defined(TARGET_PPC64)
     if (!ctx->sf_mode)
#1 lore raw
Quoted 5 lines · Andreas Färber

Silences a warning about possible unitialized use of t0.

The remaining ca. three warnings seemed to be due to GCC's dumbness to not recognize identical conditions.

Thanks applied.

Signature · 4 lines
  .''`.  Aurelien Jarno	            | GPG: 1024D/F1BCDB73
 : :' :  Debian developer           | Electrical Engineer
 `. `'   [email protected]         | [email protected]
   `-    people.debian.org/~aurel32 | www.aurel32.net
#2 lore raw
In reply to Andreas Färber
Quoted 5 lines · Andreas Färber
target-ppc/translate.c +0 -0
index 31d7387..a239ebd 100644

target-ppc/translate.c GEN_HANDLER(tlbiva, 0x1F, 0x12, 0x18, 0x03FFF801, PPC_TLBIVA) · line 5388

Quoted 9 lines
target-ppc/translate.c +1 -1
@@ -5381,11 +5381,11 @@ GEN_HANDLER(tlbiva, 0x1F, 0x12, 0x18, 0x03FFF801, PPC_TLBIVA)
 #if defined(CONFIG_USER_ONLY)
     GEN_EXCP_PRIVOPC(ctx);
 #else
-    TCGv t0;
     if (unlikely(!ctx->supervisor)) {
         GEN_EXCP_PRIVOPC(ctx);
         return;
     }
+    TCGv t0 = tcg_temp_new();

Does Qemu require a C99 compiler?

Andreas.

Signature · 4 lines
Andreas Schwab, SuSE Labs, [email protected]
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."
#3 lore raw

Am 07.12.2008 um 18:09 schrieb Andreas Schwab:

Quoted 11 lines
Quoted 9 lines · Andreas Färber
target-ppc/translate.c +0 -0
index 31d7387..a239ebd 100644
@@ -5381,11 +5381,11 @@ GEN_HANDLER(tlbiva, 0x1F, 0x12, 0x18,  
 0x03FFF801, PPC_TLBIVA)
 #if defined(CONFIG_USER_ONLY)
    GEN_EXCP_PRIVOPC(ctx);
 #else
Quoted 8 lines

target-ppc/translate.c GEN_HANDLER(tlbiva, 0x1F, 0x12, 0x18, 0x03FFF801, PPC_TLBIVA) · line 5388

Quoted 6 lines
target-ppc/translate.c +1 -1
-    TCGv t0;
    if (unlikely(!ctx->supervisor)) {
        GEN_EXCP_PRIVOPC(ctx);
        return;
    }
+    TCGv t0 = tcg_temp_new();

Does Qemu require a C99 compiler?

Unfortunately yes. But Aurélien's commit avoided it here by adding only an assignment.

Andreas