summaryrefslogtreecommitdiffstats
path: root/tcg
diff options
context:
space:
mode:
authorRichard Henderson2015-03-13 20:26:21 +0100
committerRichard Henderson2015-03-16 16:46:13 +0100
commit2374c4b8375072da1f401c6daccc68ae76c73e63 (patch)
treed2e2a22f0adb1d001cb6ccfe0c4a2a6f3bed21a1 /tcg
parentMerge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20150316'... (diff)
downloadqemu-2374c4b8375072da1f401c6daccc68ae76c73e63.tar.gz
qemu-2374c4b8375072da1f401c6daccc68ae76c73e63.tar.xz
qemu-2374c4b8375072da1f401c6daccc68ae76c73e63.zip
tcg/optimize: Handle or r,a,a with constant a
As seen with ubuntu-5.10-live-powerpc.iso. Reported-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Reviewed-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de> Signed-off-by: Richard Henderson <rth@twiddle.net>
Diffstat (limited to 'tcg')
-rw-r--r--tcg/optimize.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/tcg/optimize.c b/tcg/optimize.c
index 067917c396..37c11103a6 100644
--- a/tcg/optimize.c
+++ b/tcg/optimize.c
@@ -980,8 +980,11 @@ static void tcg_constant_folding(TCGContext *s)
if (temps_are_copies(args[1], args[2])) {
if (temps_are_copies(args[0], args[1])) {
tcg_op_remove(s, op);
- } else {
+ } else if (temps[args[1]].state != TCG_TEMP_CONST) {
tcg_opt_gen_mov(s, op, args, opc, args[0], args[1]);
+ } else {
+ tcg_opt_gen_movi(s, op, args, opc,
+ args[0], temps[args[1]].val);
}
continue;
}