Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Jxr9z-0004Dp-Rr for qemu-devel@nongnu.org; Sun, 18 May 2008 18:15:19 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Jxr9y-0004D6-Ak for qemu-devel@nongnu.org; Sun, 18 May 2008 18:15:19 -0400 Received: from [199.232.76.173] (port=59701 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jxr9y-0004D3-87 for qemu-devel@nongnu.org; Sun, 18 May 2008 18:15:18 -0400 Received: from savannah.gnu.org ([199.232.41.3]:44825 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Jxr9x-0002bS-W9 for qemu-devel@nongnu.org; Sun, 18 May 2008 18:15:18 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1Jxr9t-0005h5-TD for qemu-devel@nongnu.org; Sun, 18 May 2008 22:15:14 +0000 Received: from ths by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1Jxr9t-0005gq-D2 for qemu-devel@nongnu.org; Sun, 18 May 2008 22:15:13 +0000 MIME-Version: 1.0 Errors-To: ths Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Thiemo Seufer Message-Id: Date: Sun, 18 May 2008 22:15:13 +0000 Subject: [Qemu-devel] [4495] Fix local register cache handling. Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Revision: 4495 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=4495 Author: ths Date: 2008-05-18 22:15:12 +0000 (Sun, 18 May 2008) Log Message: ----------- Fix local register cache handling. Modified Paths: -------------- trunk/target-mips/translate.c Modified: trunk/target-mips/translate.c =================================================================== --- trunk/target-mips/translate.c 2008-05-18 19:28:26 UTC (rev 4494) +++ trunk/target-mips/translate.c 2008-05-18 22:15:12 UTC (rev 4495) @@ -504,7 +504,7 @@ /* Moves to/from shadow registers */ static inline void gen_op_load_srsgpr_T0(int reg) { - int r_tmp = new_tmp(); + TCGv r_tmp = new_tmp(); tcg_gen_ld_i32(r_tmp, cpu_env, offsetof(CPUState, CP0_SRSCtl)); tcg_gen_shri_i32(r_tmp, r_tmp, CP0SRSCtl_PSS); @@ -518,7 +518,7 @@ static inline void gen_op_store_srsgpr_T0(int reg) { - int r_tmp = new_tmp(); + TCGv r_tmp = new_tmp(); tcg_gen_ld_i32(r_tmp, cpu_env, offsetof(CPUState, CP0_SRSCtl)); tcg_gen_shri_i32(r_tmp, r_tmp, CP0SRSCtl_PSS); @@ -1016,7 +1016,7 @@ #define OP_ST_ATOMIC(insn,fname,almask) \ void inline op_ldst_##insn(DisasContext *ctx) \ { \ - int r_tmp = tcg_temp_new(TCG_TYPE_TL); \ + TCGv r_tmp = tcg_temp_new(TCG_TYPE_TL); \ int l1 = gen_new_label(); \ int l2 = gen_new_label(); \ int l3 = gen_new_label(); \ @@ -1956,7 +1956,7 @@ static inline void tcg_gen_jnz_bcond(int label) { - int r_tmp = tcg_temp_new(TCG_TYPE_TL); + TCGv r_tmp = tcg_temp_new(TCG_TYPE_TL); tcg_gen_ld_tl(r_tmp, cpu_env, offsetof(CPUState, bcond)); tcg_gen_brcond_tl(TCG_COND_NE, r_tmp, tcg_const_tl(0), label); @@ -6834,6 +6834,9 @@ if (search_pc && loglevel) fprintf (logfile, "search pc %d\n", search_pc); + num_temps = 0; + memset(temps, 0, sizeof(temps)); + pc_start = tb->pc; gen_opc_end = gen_opc_buf + OPC_MAX_SIZE; ctx.pc = pc_start; @@ -6888,6 +6891,12 @@ } ctx.opcode = ldl_code(ctx.pc); decode_opc(env, &ctx); + if (num_temps) { + fprintf(stderr, + "Internal resource leak before " TARGET_FMT_lx "\n", + ctx.pc); + num_temps = 0; + } ctx.pc += 4; if (env->singlestep_enabled)