* TAOptObj.MakeUnconditional: Set as internal error for MIPS cpu:

MIPS conditional instructions conntain the
     computation of the condition itself, so
     changing the instruction to unconditional
     should never be done.
  * TAOptObj.OptimizeConditionalJump: Return false early if
    the conditional instruction has more than one operand.

git-svn-id: trunk@45782 -
This commit is contained in:
pierre 2020-07-14 05:52:54 +00:00
parent 8cf26b7a0f
commit cca536a86a

View File

@ -1635,6 +1635,13 @@ Unit AoptObj;
p.ops:=2;
{$endif}
{$endif not avr}
{$ifdef mips}
{ MIPS conditional instructions conntain the
computation of the condition itself, so
changing the instruction to unconditional
should never be done. }
internalerror(2020071301);
{$endif}
end;
@ -1937,6 +1944,14 @@ Unit AoptObj;
NCJLabel: TAsmLabel;
begin
Result := False;
{ Do not try to optimize if the test generating the condition
is the same instruction, like 'bne $v0,$zero,.Lj3' for MIPS }
if (taicpu(p).ops>1) or ((hp1.typ=ait_instruction) and
(taicpu(hp1).ops>1)) then
begin
stoploop:=false;
exit;
end;
while (hp1 <> BlockEnd) do
begin
StripDeadLabels(hp1, hp1);