From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JrbHF-0003ye-HZ for qemu-devel@nongnu.org; Thu, 01 May 2008 12:04:57 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JrbHD-0003uY-QR for qemu-devel@nongnu.org; Thu, 01 May 2008 12:04:57 -0400 Received: from [199.232.76.173] (port=50658 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JrbHD-0003u6-Kf for qemu-devel@nongnu.org; Thu, 01 May 2008 12:04:55 -0400 Received: from mail.codesourcery.com ([65.74.133.4]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JrbHC-0001c0-SI for qemu-devel@nongnu.org; Thu, 01 May 2008 12:04:55 -0400 From: Paul Brook Subject: Re: [Qemu-devel] Crash due to invalid env->current_tb Date: Thu, 1 May 2008 17:04:43 +0100 References: <20080429115614.GA15524@os.inf.tu-dresden.de> <20080501120241.GC13241@os.inf.tu-dresden.de> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200805011704.43953.paul@codesourcery.com> 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 Cc: Blue Swirl > > T0 = gen_func(); > > > > For 64bit target T0 is 64bits so "=a" does not work and "=A" is needed. > > The strange thing is that I need to throw away the upper 32bits because > > otherwise it won't work. gen_func is defined to return just long but T0 > > is unsigned long long, this seems inconsistent. The 'and' does not > > appear in 32bit targets so it does not harm there. > > This is because in this special case, T0 is not used as target CPU > temporary, but instead to return next TB address. On i386 this is 32 > bits, so only EAX is needed. TCG does not touch EDX, so it contains > garbage. This also means that moving EDX to high word of T0 and then > throwing the high word away may be slightly wasteful. Do we need to use T0 at all here? Can't we just use a normal local variable? Paul