]> git.proxmox.com Git - mirror_qemu.git/commit
tcg: fix register allocation with two aliased dead inputs
authorAurelien Jarno <aurelien@aurel32.net>
Thu, 4 Jun 2015 19:47:07 +0000 (21:47 +0200)
committerRichard Henderson <rth@twiddle.net>
Tue, 9 Jun 2015 13:42:27 +0000 (06:42 -0700)
commit7e1df267a7e8b39fc0cf1d84d2afc2e88ccbfeac
treec85f3366cdd2a5bc1e5710f3af2428f838a75ed9
parent59c4b7e8dfab0cdc41434fedbf2686222f541e57
tcg: fix register allocation with two aliased dead inputs

For TCG ops with two outputs registers (add2, sub2, div2, div2u), when
the same input temp is used for the two inputs aliased to the two
outputs, and when these inputs are both dead, the register allocation
code wrongly assigned the same register to the same output.

This happens for example with sub2 t1, t2, t3, t3, t4, t5, when t3 is
not used anymore after the TCG op.  In that case the same register is
used for t1, t2 and t3.

The fix is to look for already allocated aliased input when allocating
a dead aliased input and check that the register is not already
used.

Cc: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Message-Id: <1433447228-29425-2-git-send-email-aurelien@aurel32.net>
Signed-off-by: Richard Henderson <rth@twiddle.net>
tcg/tcg.c