From: Blue Swirl <blauwirbel@gmail.com>
To: qemu-devel <qemu-devel@nongnu.org>,
"Edgar E. Iglesias" <edgar.iglesias@gmail.com>
Subject: [Qemu-devel] [PATCH 07/11] cris: avoid write only variables
Date: Wed, 6 Oct 2010 21:33:38 +0000 [thread overview]
Message-ID: <AANLkTimd2RhjGySCp0RmRBGweBXc9Adi31vScFCOfBK-@mail.gmail.com> (raw)
Compiling with GCC 4.6.0 20100925 produced warnings:
/src/qemu/target-cris/op_helper.c: In function 'helper_movl_sreg_reg':
/src/qemu/target-cris/op_helper.c:145:8: error: variable 'tlb_v' set
but not used [-Werror=unused-but-set-variable]
In file included from /src/qemu/target-cris/translate.c:3154:0:
/src/qemu/target-cris/translate_v10.c: In function 'dec10_prep_move_m':
/src/qemu/target-cris/translate_v10.c:111:22: error: variable 'rd' set
but not used [-Werror=unused-but-set-variable]
Fix by making the variable declarations and their uses also conditional
to debug definition, delete rd.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
---
target-cris/op_helper.c | 6 ++++++
target-cris/translate_v10.c | 5 ++---
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/target-cris/op_helper.c b/target-cris/op_helper.c
index a60da94..28c79b1 100644
--- a/target-cris/op_helper.c
+++ b/target-cris/op_helper.c
@@ -142,7 +142,9 @@ void helper_movl_sreg_reg (uint32_t sreg, uint32_t reg)
uint32_t idx;
uint32_t lo, hi;
uint32_t vaddr;
+#ifdef CRIS_OP_HELPER_DEBUG
int tlb_v;
+#endif
idx = set = env->sregs[SFR_RW_MM_TLB_SEL];
set >>= 4;
@@ -157,13 +159,17 @@ void helper_movl_sreg_reg (uint32_t sreg, uint32_t reg)
vaddr = EXTRACT_FIELD(env->tlbsets[srs-1][set][idx].hi,
13, 31);
vaddr <<= TARGET_PAGE_BITS;
+#ifdef CRIS_OP_HELPER_DEBUG
tlb_v = EXTRACT_FIELD(env->tlbsets[srs-1][set][idx].lo,
3, 3);
+#endif
env->tlbsets[srs - 1][set][idx].lo = lo;
env->tlbsets[srs - 1][set][idx].hi = hi;
+#ifdef CRIS_OP_HELPER_DEBUG
D_LOG("tlb flush vaddr=%x v=%d pc=%x\n",
vaddr, tlb_v, env->pc);
+#endif
tlb_flush_page(env, vaddr);
}
}
diff --git a/target-cris/translate_v10.c b/target-cris/translate_v10.c
index 14e590d..6944827 100644
--- a/target-cris/translate_v10.c
+++ b/target-cris/translate_v10.c
@@ -108,16 +108,15 @@ static unsigned int
crisv10_post_memaddr(DisasContext *dc, unsigned int size)
static int dec10_prep_move_m(DisasContext *dc, int s_ext, int memsize,
TCGv dst)
{
- unsigned int rs, rd;
+ unsigned int rs;
uint32_t imm;
int is_imm;
int insn_len = 0;
rs = dc->src;
- rd = dc->dst;
is_imm = rs == 15 && !(dc->tb_flags & PFIX_FLAG);
LOG_DIS("rs=%d rd=%d is_imm=%d mode=%d pfix=%d\n",
- rs, rd, is_imm, dc->mode, dc->tb_flags & PFIX_FLAG);
+ rs, dc->dst, is_imm, dc->mode, dc->tb_flags & PFIX_FLAG);
/* Load [$rs] onto T1. */
if (is_imm) {
--
1.6.2.4
next reply other threads:[~2010-10-06 21:34 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-06 21:33 Blue Swirl [this message]
2010-10-07 10:08 ` [Qemu-devel] [PATCH 07/11] cris: avoid write only variables Markus Armbruster
2010-10-07 11:07 ` Edgar E. Iglesias
2010-10-07 17:57 ` Blue Swirl
2010-10-07 19:44 ` Edgar E. Iglesias
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=AANLkTimd2RhjGySCp0RmRBGweBXc9Adi31vScFCOfBK-@mail.gmail.com \
--to=blauwirbel@gmail.com \
--cc=edgar.iglesias@gmail.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).