From: Richard Henderson Date: Fri, 13 Mar 2015 19:26:21 +0000 (-0700) Subject: tcg/optimize: Handle or r,a,a with constant a X-Git-Tag: v2.3.0-rc0~8^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2374c4b8375072da1f401c6daccc68ae76c73e63;p=thirdparty%2Fqemu.git tcg/optimize: Handle or r,a,a with constant a As seen with ubuntu-5.10-live-powerpc.iso. Reported-by: Mark Cave-Ayland Tested-by: Mark Cave-Ayland Reviewed-by: Bastian Koppelmann Signed-off-by: Richard Henderson --- diff --git a/tcg/optimize.c b/tcg/optimize.c index 067917c396f..37c11103a62 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; }