Received: from eggs.gnu.org ([2001:4830:134:3::10]:35582) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z7jMl-0005zi-Fv for qemu-devel@nongnu.org; Wed, 24 Jun 2015 08:01:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z7jMg-0002ad-9p for qemu-devel@nongnu.org; Wed, 24 Jun 2015 08:01:19 -0400 From: Paolo Bonzini Date: Wed, 24 Jun 2015 14:01:10 +0200 Message-Id: <1435147270-1040-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH] target-tricore: fix depositing bits from PCXI into ICR List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: qemu-trivial@nongnu.org, Bastian Koppelmann Spotted by Coverity, because (env->PCXI & MASK_PCXI_PCPN) >> 24 is always zero. The immediately preceding assignment is also wrong though. Signed-off-by: Paolo Bonzini --- target-tricore/op_helper.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target-tricore/op_helper.c b/target-tricore/op_helper.c index 10ed541..53edbda 100644 --- a/target-tricore/op_helper.c +++ b/target-tricore/op_helper.c @@ -2545,10 +2545,10 @@ void helper_rfm(CPUTriCoreState *env) env->PC = (env->gpr_a[11] & ~0x1); /* ICR.IE = PCXI.PIE; */ env->ICR = (env->ICR & ~MASK_ICR_IE) | - ((env->PCXI & ~MASK_PCXI_PIE) >> 15); + ((env->PCXI & MASK_PCXI_PIE) >> 15); /* ICR.CCPN = PCXI.PCPN; */ env->ICR = (env->ICR & ~MASK_ICR_CCPN) | - ((env->PCXI & ~MASK_PCXI_PCPN) >> 24); + ((env->PCXI & MASK_PCXI_PCPN) >> 24); /* {PCXI, PSW, A[10], A[11]} = M(DCX, 4 * word); */ env->PCXI = cpu_ldl_data(env, env->DCX); psw_write(env, cpu_ldl_data(env, env->DCX+4)); -- 2.4.3