From 35ff024f032275ade197a50f6b539f88d03c7b9c Mon Sep 17 00:00:00 2001 From: yury Date: Wed, 21 Oct 2015 12:14:49 +0000 Subject: [PATCH] * mips: Fixed internal error 2014061703 when optimization are enabled. git-svn-id: trunk@32112 - --- compiler/mips/aoptcpu.pas | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/compiler/mips/aoptcpu.pas b/compiler/mips/aoptcpu.pas index 8623fc8898..8b498f37b2 100644 --- a/compiler/mips/aoptcpu.pas +++ b/compiler/mips/aoptcpu.pas @@ -742,27 +742,29 @@ unit aoptcpu; GetNextInstruction(hp1, hp1); end; { hp1 points to yyy: } - if assigned(hp1) and + if assigned(hp1) and (l<=3) and FindLabel(tasmlabel(taicpu(hp2).oper[taicpu(hp2).ops-1]^.ref^.symbol),hp1) then begin condition:=inverse_cond(taicpu(p).condition); GetNextInstruction(p,hp1); hp3:=p; p:=hp1; - repeat - ChangeToCMOV(taicpu(hp1),condition,condreg); - GetNextInstruction(hp1,hp1); - until not CanBeCMOV(hp1,condreg); + while CanBeCMOV(hp1,condreg) do + begin + ChangeToCMOV(taicpu(hp1),condition,condreg); + GetNextInstruction(hp1,hp1); + end; { hp2 is still at b yyy } GetNextInstruction(hp2,hp1); { hp2 is now at xxx: } condition:=inverse_cond(condition); GetNextInstruction(hp1,hp1); { hp1 is now at } - repeat - ChangeToCMOV(taicpu(hp1),condition,condreg); - GetNextInstruction(hp1,hp1); - until not CanBeCMOV(hp1,condreg); + while CanBeCMOV(hp1,condreg) do + begin + ChangeToCMOV(taicpu(hp1),condition,condreg); + GetNextInstruction(hp1,hp1); + end; { remove bCC } tasmlabel(taicpu(hp3).oper[taicpu(hp3).ops-1]^.ref^.symbol).decrefs; RemoveDelaySlot(hp3);