Fixed two bugs in the x86 peephole optimizer.

git-svn-id: trunk@34497 -
This commit is contained in:
Jeppe Johansen 2016-09-10 19:13:48 +00:00
parent 6798504842
commit 348c373e9f

View File

@ -557,6 +557,7 @@ unit aoptx86;
MatchOperand(taicpu(p).oper[1]^,taicpu(hp1).oper[0]^) then
begin
CopyUsedRegs(TmpUsedRegs);
UpdateUsedRegs(TmpUsedRegs, tai(p.Next));
{ we have
mov x, %treg
mov %treg, y
@ -913,6 +914,7 @@ unit aoptx86;
GetNextInstruction(hp1, hp2) and
MatchInstruction(hp2,A_MOV,[]) and
OpsEqual(taicpu(hp2).oper[1]^, taicpu(p).oper[0]^) and
OpsEqual(taicpu(hp2).oper[0]^, taicpu(p).oper[1]^) and
(IsFoldableArithOp(taicpu(hp1), taicpu(p).oper[1]^.reg) or
((taicpu(p).opsize=S_L) and (taicpu(hp1).opsize=S_Q) and
IsFoldableArithOp(taicpu(hp1), newreg(R_INTREGISTER,getsupreg(taicpu(p).oper[1]^.reg),R_SUBQ)))