]> rtime.felk.cvut.cz Git - lisovros/qemu_apohw.git/commit
TCG: Fix I64-on-32bit-host temporaries
authorAlexander Graf <agraf@suse.de>
Sun, 19 Jan 2014 15:53:31 +0000 (16:53 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Thu, 30 Jan 2014 13:25:28 +0000 (13:25 +0000)
commit18d13fa293af8e54e15c4651f99b24a139c9eb43
tree8276b0902c1592d299b00138b5d6a3082a8e6b68
parent0169c511554cb0014a00290b0d3d26c31a49818f
TCG: Fix I64-on-32bit-host temporaries

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 <agraf@suse.de>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Message-id: 1390146811-59936-1-git-send-email-agraf@suse.de
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
tcg/tcg.c