Procházet zdrojové kódy

* SPARC peephole: check that result of GetNextInstructionUsingReg is actually an instruction, because GetNextInstruction can stop at a label. Resolves #26798.
The same issue on MIPS targets was fixed by r28380, but I forgot to apply it also to SPARC.

git-svn-id: trunk@28722 -

sergei před 11 roky
rodič
revize
b70c5efa65
1 změnil soubory, kde provedl 1 přidání a 1 odebrání
  1. 1 1
      compiler/sparc/aoptcpu.pas

+ 1 - 1
compiler/sparc/aoptcpu.pas

@@ -127,7 +127,7 @@ unit aoptcpu;
         Result:=GetNextInstruction(Next,Next);
       until {not(cs_opt_level3 in current_settings.optimizerswitches) or} not(Result) or (Next.typ<>ait_instruction) or (RegInInstruction(reg,Next)) or
         (is_calljmp(taicpu(Next).opcode));
-      if is_calljmp(taicpu(next).opcode) then
+      if result and (next.typ=ait_instruction) and is_calljmp(taicpu(next).opcode) then
         begin
           result:=false;
           next:=nil;