Received: from eggs.gnu.org ([140.186.70.92]:46600) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ROu6R-00031V-4h for qemu-devel@nongnu.org; Fri, 11 Nov 2011 11:37:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ROu6P-0007ht-5r for qemu-devel@nongnu.org; Fri, 11 Nov 2011 11:37:19 -0500 Received: from cantor2.suse.de ([195.135.220.15]:41281 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ROu6O-0007hY-Rh for qemu-devel@nongnu.org; Fri, 11 Nov 2011 11:37:17 -0500 From: Alexander Graf Date: Fri, 11 Nov 2011 17:37:27 +0100 Message-Id: <1321029448-11010-3-git-send-email-agraf@suse.de> In-Reply-To: <1321029448-11010-1-git-send-email-agraf@suse.de> References: <1321029448-11010-1-git-send-email-agraf@suse.de> Subject: [Qemu-devel] [PATCH 2/3] tcg-ppc64: Fix compile errors for userspace only builds with gcc 4.6 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel Developers Cc: blauwirbel@gmail.com, David Gibson From: David Gibson tcg/ppc64/tcg-target.c has a couple of places where variables are set unconditionally, but otherwise used only for softmmu builds, not userspace only builds. This causes compiler warnings (which are fatal by default) when compiling for a ppc64 host with gcc 4.6. This patch fixes the problem by moving the code which defines and sets the variables into the CONFIG_SOFTMMU guarded regions. Signed-off-by: David Gibson Signed-off-by: Alexander Graf --- tcg/ppc64/tcg-target.c | 14 ++++++++------ 1 files changed, 8 insertions(+), 6 deletions(-) diff --git a/tcg/ppc64/tcg-target.c b/tcg/ppc64/tcg-target.c index 3d24cd4..41f1e85 100644 --- a/tcg/ppc64/tcg-target.c +++ b/tcg/ppc64/tcg-target.c @@ -616,18 +616,19 @@ static void tcg_out_tlb_read (TCGContext *s, int r0, int r1, int r2, static void tcg_out_qemu_ld (TCGContext *s, const TCGArg *args, int opc) { - int addr_reg, data_reg, r0, r1, rbase, mem_index, s_bits, bswap; + int addr_reg, data_reg, r0, r1, rbase, bswap; #ifdef CONFIG_SOFTMMU - int r2; + int r2, mem_index, s_bits; void *label1_ptr, *label2_ptr; #endif data_reg = *args++; addr_reg = *args++; + +#ifdef CONFIG_SOFTMMU mem_index = *args; s_bits = opc & 3; -#ifdef CONFIG_SOFTMMU r0 = 3; r1 = 4; r2 = 0; @@ -763,17 +764,18 @@ static void tcg_out_qemu_ld (TCGContext *s, const TCGArg *args, int opc) static void tcg_out_qemu_st (TCGContext *s, const TCGArg *args, int opc) { - int addr_reg, r0, r1, rbase, data_reg, mem_index, bswap; + int addr_reg, r0, r1, rbase, data_reg, bswap; #ifdef CONFIG_SOFTMMU - int r2; + int r2, mem_index; void *label1_ptr, *label2_ptr; #endif data_reg = *args++; addr_reg = *args++; - mem_index = *args; #ifdef CONFIG_SOFTMMU + mem_index = *args; + r0 = 3; r1 = 4; r2 = 0; -- 1.6.0.2