From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53925) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W5eIz-00084s-Qo for qemu-devel@nongnu.org; Tue, 21 Jan 2014 11:36:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W5eIu-0004Je-Uu for qemu-devel@nongnu.org; Tue, 21 Jan 2014 11:36:01 -0500 Received: from mail-qc0-x235.google.com ([2607:f8b0:400d:c01::235]:56487) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W5eIu-0004JU-QT for qemu-devel@nongnu.org; Tue, 21 Jan 2014 11:35:56 -0500 Received: by mail-qc0-f181.google.com with SMTP id e9so7124742qcy.40 for ; Tue, 21 Jan 2014 08:35:56 -0800 (PST) Sender: Richard Henderson Message-ID: <52DEA1E8.5030007@twiddle.net> Date: Tue, 21 Jan 2014 08:35:52 -0800 From: Richard Henderson MIME-Version: 1.0 References: <1390146811-59936-1-git-send-email-agraf@suse.de> In-Reply-To: <1390146811-59936-1-git-send-email-agraf@suse.de> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] TCG: Fix I64-on-32bit-host temporaries List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf , qemu-devel@nongnu.org On 01/19/2014 07:53 AM, Alexander Graf wrote: > We have cache pools of temporaries that we can reuse later when they've > already been allocated before. > > These cache pools differenciate between the target TCG variable type they > contain. So we have one pool for I32 and one pool for I64 variables. > > On a 32bit system, we can't work with 64bit registers though. So instead we > spawn two I32 temporaries for every I64 temporary we create. All caching > works the same way as on a real 64-bit system though: We create a cache entry > in the 64bit array for the first i32 index. > > However, when we free such a temporary we free it to the pool of its type > (which is always i32 on 32bit systems) rather than its base_type (which is > i64 or i32 depending on the variable). This means we put a temporary that > is of base_type == i64 into the i32 preallocated temporary pool. > > Eventually, this results in failures like this on 32bit hosts: > > qemu-system-ppc64: tcg/tcg.c:515: tcg_temp_new_internal: Assertion `ts->base_type == type' failed. > > This patch makes the free routine use the base_type instead for the free case, > so it's consistent with the temporary allocation. It fixes the above failure > for me. > > Signed-off-by: Alexander Graf > --- > tcg/tcg.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Richard Henderson r~