2
0
Эх сурвалжийг харах

* Modified FindRegAlloc() to skip branch delay slots in the same way it is done in GetNextInstruction(). This fixes processing sequences "dealloc reg; branch reg,label; NOP; alloc reg" in BuildLabelTableAndFixRegAlloc(), deallocation is now correctly moved after branch. Before this change, the last allocation was ignored, and deallocation was moved forward until another instruction using reg was encountered.

git-svn-id: trunk@28891 -
sergei 10 жил өмнө
parent
commit
0041024e5f

+ 3 - 0
compiler/aoptobj.pas

@@ -1041,6 +1041,9 @@ Unit AoptObj;
         Repeat
         Repeat
           While Assigned(StartPai) And
           While Assigned(StartPai) And
                 ((StartPai.typ in (SkipInstr - [ait_regAlloc])) Or
                 ((StartPai.typ in (SkipInstr - [ait_regAlloc])) Or
+{$if defined(MIPS) or defined(SPARC)}
+                ((startpai.typ=ait_instruction) and (taicpu(startpai).opcode=A_NOP)) or
+{$endif MIPS or SPARC}
                  ((StartPai.typ = ait_label) and
                  ((StartPai.typ = ait_label) and
                   Not(Tai_Label(StartPai).labsym.Is_Used))) Do
                   Not(Tai_Label(StartPai).labsym.Is_Used))) Do
             StartPai := Tai(StartPai.Next);
             StartPai := Tai(StartPai.Next);