Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LbDDe-0002aN-2k for qemu-devel@nongnu.org; Sun, 22 Feb 2009 07:14:02 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LbDDd-0002ZN-1f for qemu-devel@nongnu.org; Sun, 22 Feb 2009 07:14:01 -0500 Received: from [199.232.76.173] (port=42585 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LbDDc-0002ZK-Uo for qemu-devel@nongnu.org; Sun, 22 Feb 2009 07:14:00 -0500 Received: from bart.se.axis.com ([195.60.68.10]:44502) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LbDDc-0000R9-8O for qemu-devel@nongnu.org; Sun, 22 Feb 2009 07:14:00 -0500 Received: from bart.se.axis.com (localhost [127.0.0.1]) by bart.se.axis.com (Postfix) with ESMTP id EA17E640EA for ; Sun, 22 Feb 2009 13:13:58 +0100 (CET) Received: from axis.com (edgar.se.axis.com [10.93.151.1]) by bart.se.axis.com (Postfix) with ESMTP id DD25A640D8 for ; Sun, 22 Feb 2009 13:13:58 +0100 (CET) Date: Sun, 22 Feb 2009 15:14:20 +0100 From: "Edgar E. Iglesias" Subject: Re: [Qemu-devel] [PATCH v2 5/7] clean build: Fix remaining cris warnings Message-ID: <20090222141420.GB23840@edgar.se.axis.com> References: <20090221190054.12485.30486.stgit@mchn012c.ww002.siemens.net> <20090221190055.12485.92159.stgit@mchn012c.ww002.siemens.net> <20090221230359.GA19611@miranda.arrow> <761ea48b0902211513h12ddaf09x4dab923f8512a128@mail.gmail.com> <49A12AA3.1040505@web.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <49A12AA3.1040505@web.de> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jan Kiszka Cc: qemu-devel@nongnu.org On Sun, Feb 22, 2009 at 11:36:19AM +0100, Jan Kiszka wrote: > Laurent Desnogues wrote: > > On Sun, Feb 22, 2009 at 12:03 AM, Stuart Brady wrote: > >> On Sat, Feb 21, 2009 at 08:00:55PM +0100, Jan Kiszka wrote: > >>> diff --git a/target-cris/translate.c b/target-cris/translate.c > >>> index f575e63..954b038 100644 > >>> --- a/target-cris/translate.c > >>> +++ b/target-cris/translate.c > >>> @@ -2613,7 +2613,7 @@ static unsigned int dec_move_pm(DisasContext *dc) > >>> static unsigned int dec_movem_mr(DisasContext *dc) > >>> { > >>> TCGv_i64 tmp[16]; > >>> - TCGv tmp32; > >>> + TCGv tmp32 = 0; > >>> TCGv addr; > >>> int i; > >>> int nr = dc->op2 + 1; > >> Hmm, GCC just gets it wrong here -- and 0 isn't really very meaningful. > >> At the very least, shouldn't there be a comment? Something like Linux's > >> uninitialized_var() macro might be worth considering... > > > > Some targets use TCGV_UNUSED_I32/I64. I would initialize tmp32 > > to that value in an additional else part to the first if (nr & 1). That > > should silence gcc. > > > > Good point, here is a fixed version according to your suggestion: > > -------------> Applied, thanks everybody. > > Signed-off-by: Jan Kiszka > --- > > hw/etraxfs_eth.c | 3 +-- > hw/etraxfs_ser.c | 1 + > hw/etraxfs_timer.c | 1 + > target-cris/cpu.h | 3 +++ > target-cris/exec.h | 3 --- > target-cris/translate.c | 3 ++- > 6 files changed, 8 insertions(+), 6 deletions(-) > > diff --git a/hw/etraxfs_eth.c b/hw/etraxfs_eth.c > index 13d1900..c87e55f 100644 > --- a/hw/etraxfs_eth.c > +++ b/hw/etraxfs_eth.c > @@ -25,8 +25,7 @@ > #include > #include "hw.h" > #include "net.h" > - > -#include "etraxfs_dma.h" > +#include "etraxfs.h" > > #define D(x) > > diff --git a/hw/etraxfs_ser.c b/hw/etraxfs_ser.c > index e32e2eb..8367386 100644 > --- a/hw/etraxfs_ser.c > +++ b/hw/etraxfs_ser.c > @@ -26,6 +26,7 @@ > #include > #include "hw.h" > #include "qemu-char.h" > +#include "etraxfs.h" > > #define D(x) > > diff --git a/hw/etraxfs_timer.c b/hw/etraxfs_timer.c > index ebb06e1..1144369 100644 > --- a/hw/etraxfs_timer.c > +++ b/hw/etraxfs_timer.c > @@ -26,6 +26,7 @@ > #include "hw.h" > #include "sysemu.h" > #include "qemu-timer.h" > +#include "etraxfs.h" > > #define D(x) > > diff --git a/target-cris/cpu.h b/target-cris/cpu.h > index dea4cc4..754953c 100644 > --- a/target-cris/cpu.h > +++ b/target-cris/cpu.h > @@ -216,6 +216,9 @@ static inline int cpu_mmu_index (CPUState *env) > return !!(env->pregs[PR_CCS] & U_FLAG); > } > > +int cpu_cris_handle_mmu_fault(CPUState *env, target_ulong address, int rw, > + int mmu_idx, int is_softmmu); > + > #if defined(CONFIG_USER_ONLY) > static inline void cpu_clone_regs(CPUState *env, target_ulong newsp) > { > diff --git a/target-cris/exec.h b/target-cris/exec.h > index cce87f6..77e4240 100644 > --- a/target-cris/exec.h > +++ b/target-cris/exec.h > @@ -33,9 +33,6 @@ static inline void regs_to_env(void) > { > } > > -int cpu_cris_handle_mmu_fault (CPUState *env, target_ulong address, int rw, > - int mmu_idx, int is_softmmu); > - > #if !defined(CONFIG_USER_ONLY) > #include "softmmu_exec.h" > #endif > diff --git a/target-cris/translate.c b/target-cris/translate.c > index f575e63..d5fcb9e 100644 > --- a/target-cris/translate.c > +++ b/target-cris/translate.c > @@ -2633,7 +2633,8 @@ static unsigned int dec_movem_mr(DisasContext *dc) > tmp32 = tcg_temp_new_i32(); > tcg_gen_addi_tl(addr, cpu_R[dc->op1], i * 8); > gen_load(dc, tmp32, addr, 4, 0); > - } > + } else > + TCGV_UNUSED(tmp32); > tcg_temp_free(addr); > > for (i = 0; i < (nr >> 1); i++) { >