diff mbox

[3/3] tcg-sparc: Fix set-but-not used warnings.

Message ID 1320861815-14317-4-git-send-email-rth@twiddle.net
State New
Headers show

Commit Message

Richard Henderson Nov. 9, 2011, 6:03 p.m. UTC
In both cases, val is computed, but then not used in the
subsequent line, which then re-computes the quantity in
a different type (int32_t vs unsigned long).

Keep the computation type that's been working so far.

Signed-off-by: Richard Henderson <rth@twiddle.net>
---
 tcg/sparc/tcg-target.c |    4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)

Comments

Blue Swirl Nov. 19, 2011, 1:59 p.m. UTC | #1
Thanks, applied.

On Wed, Nov 9, 2011 at 18:03, Richard Henderson <rth@twiddle.net> wrote:
> In both cases, val is computed, but then not used in the
> subsequent line, which then re-computes the quantity in
> a different type (int32_t vs unsigned long).
>
> Keep the computation type that's been working so far.
>
> Signed-off-by: Richard Henderson <rth@twiddle.net>
> ---
>  tcg/sparc/tcg-target.c |    4 ----
>  1 files changed, 0 insertions(+), 4 deletions(-)
>
> diff --git a/tcg/sparc/tcg-target.c b/tcg/sparc/tcg-target.c
> index b96312b..5cd5a3b 100644
> --- a/tcg/sparc/tcg-target.c
> +++ b/tcg/sparc/tcg-target.c
> @@ -473,11 +473,9 @@ static inline void tcg_out_nop(TCGContext *s)
>
>  static void tcg_out_branch_i32(TCGContext *s, int opc, int label_index)
>  {
> -    int32_t val;
>     TCGLabel *l = &s->labels[label_index];
>
>     if (l->has_value) {
> -        val = l->u.value - (tcg_target_long)s->code_ptr;
>         tcg_out32(s, (INSN_OP(0) | INSN_COND(opc, 0) | INSN_OP2(0x2)
>                       | INSN_OFF22(l->u.value - (unsigned long)s->code_ptr)));
>     } else {
> @@ -489,11 +487,9 @@ static void tcg_out_branch_i32(TCGContext *s, int opc, int label_index)
>  #if TCG_TARGET_REG_BITS == 64
>  static void tcg_out_branch_i64(TCGContext *s, int opc, int label_index)
>  {
> -    int32_t val;
>     TCGLabel *l = &s->labels[label_index];
>
>     if (l->has_value) {
> -        val = l->u.value - (tcg_target_long)s->code_ptr;
>         tcg_out32(s, (INSN_OP(0) | INSN_COND(opc, 0) | INSN_OP2(0x1) |
>                       (0x5 << 19) |
>                       INSN_OFF19(l->u.value - (unsigned long)s->code_ptr)));
> --
> 1.7.6.4
>
>
diff mbox

Patch

diff --git a/tcg/sparc/tcg-target.c b/tcg/sparc/tcg-target.c
index b96312b..5cd5a3b 100644
--- a/tcg/sparc/tcg-target.c
+++ b/tcg/sparc/tcg-target.c
@@ -473,11 +473,9 @@  static inline void tcg_out_nop(TCGContext *s)
 
 static void tcg_out_branch_i32(TCGContext *s, int opc, int label_index)
 {
-    int32_t val;
     TCGLabel *l = &s->labels[label_index];
 
     if (l->has_value) {
-        val = l->u.value - (tcg_target_long)s->code_ptr;
         tcg_out32(s, (INSN_OP(0) | INSN_COND(opc, 0) | INSN_OP2(0x2)
                       | INSN_OFF22(l->u.value - (unsigned long)s->code_ptr)));
     } else {
@@ -489,11 +487,9 @@  static void tcg_out_branch_i32(TCGContext *s, int opc, int label_index)
 #if TCG_TARGET_REG_BITS == 64
 static void tcg_out_branch_i64(TCGContext *s, int opc, int label_index)
 {
-    int32_t val;
     TCGLabel *l = &s->labels[label_index];
 
     if (l->has_value) {
-        val = l->u.value - (tcg_target_long)s->code_ptr;
         tcg_out32(s, (INSN_OP(0) | INSN_COND(opc, 0) | INSN_OP2(0x1) |
                       (0x5 << 19) |
                       INSN_OFF19(l->u.value - (unsigned long)s->code_ptr)));