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>
This commit is contained in:
Richard Henderson 2015-03-13 12:26:21 -07:00
parent dcf848c478
commit 2374c4b837
1 changed files with 4 additions and 1 deletions

View File

@ -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;
}