From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KJ695-0005gg-Oc for qemu-devel@nongnu.org; Wed, 16 Jul 2008 08:30:11 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KJ694-0005di-IR for qemu-devel@nongnu.org; Wed, 16 Jul 2008 08:30:10 -0400 Received: from [199.232.76.173] (port=42898 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KJ694-0005dS-Dp for qemu-devel@nongnu.org; Wed, 16 Jul 2008 08:30:10 -0400 Received: from py-out-1112.google.com ([64.233.166.180]:13761) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KJ694-0001rB-TH for qemu-devel@nongnu.org; Wed, 16 Jul 2008 08:30:11 -0400 Received: by py-out-1112.google.com with SMTP id p76so3335206pyb.10 for ; Wed, 16 Jul 2008 05:30:09 -0700 (PDT) Message-ID: <761ea48b0807160530k59412f39p6ae0c90c2756fb58@mail.gmail.com> Date: Wed, 16 Jul 2008 14:30:08 +0200 From: "Laurent Desnogues" Subject: Re: [Qemu-devel] [4875] Remove unintended dereference, kills a warning (Jan Kiszka). In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-2022-JP Content-Transfer-Encoding: 7bit Content-Disposition: inline References: 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 On Wed, Jul 16, 2008 at 2:04 PM, Andreas Schwab wrote: > Andrzej Zaborowski writes: > >> void OPPROTO op_tasb_rN(void) >> { >> - cond_t(*(int8_t *) env->gregs[PARAM1] == 0); >> - *(int8_t *) env->gregs[PARAM1] |= 0x80; >> + cond_t((env->gregs[PARAM1] && 0xff) == 0); >> + *(int8_t *) &env->gregs[PARAM1] |= 0x80; > > That does not make any sense at all. The TAS insn operates on memory, > not on a register (atomic operations only make sense on memory anyway). SH4 documentation says this: TAS.B @Rn If (Rn) = 0, 1 → T, else 0 → T 1 → MSB of (Rn) So indeed it looks like Jan and Andrzej patch is wrong. Laurent