Browse Source

Fixed a source of bugs in the generic assembly optimizer. Sometimes conditional branches don't have an opposite form.

git-svn-id: branches/laksen/spc32@27972 -
Jeppe Johansen 11 years ago
parent
commit
92d2df0b82
1 changed files with 3 additions and 0 deletions
  1. 3 0
      compiler/aoptobj.pas

+ 3 - 0
compiler/aoptobj.pas

@@ -1191,12 +1191,14 @@ Unit AoptObj;
         hp2:=tai(hp1.next);
         hp2:=tai(hp1.next);
         while assigned(hp2) and (hp2.typ in SkipInstr) do
         while assigned(hp2) and (hp2.typ in SkipInstr) do
           hp2:=tai(hp2.next);
           hp2:=tai(hp2.next);
+{$ifndef SPC32}
         if assigned(hp2) and (hp2.typ=ait_instruction) and
         if assigned(hp2) and (hp2.typ=ait_instruction) and
           (taicpu(hp2).opcode=A_NOP) then
           (taicpu(hp2).opcode=A_NOP) then
           begin
           begin
             asml.remove(hp2);
             asml.remove(hp2);
             hp2.free;
             hp2.free;
           end;
           end;
+{$endif}
         { Anything except A_NOP must be left in place: these instructions
         { Anything except A_NOP must be left in place: these instructions
           execute before branch, so code stays correct if branch is removed. }
           execute before branch, so code stays correct if branch is removed. }
       end;
       end;
@@ -1398,6 +1400,7 @@ Unit AoptObj;
   {$ifdef arm}
   {$ifdef arm}
                                       and (taicpu(p).condition<>C_None)
                                       and (taicpu(p).condition<>C_None)
   {$endif arm}
   {$endif arm}
+                                      and (inverse_cond(taicpu(p).condition)<>C_None)
                                     then
                                     then
                                       begin
                                       begin
                                         taicpu(p).condition:=inverse_cond(taicpu(p).condition);
                                         taicpu(p).condition:=inverse_cond(taicpu(p).condition);