浏览代码

* 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 10 年之前
父节点
当前提交
b70c5efa65
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      compiler/sparc/aoptcpu.pas

+ 1 - 1
compiler/sparc/aoptcpu.pas

@@ -127,7 +127,7 @@ unit aoptcpu;
         Result:=GetNextInstruction(Next,Next);
         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
       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));
         (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
         begin
           result:=false;
           result:=false;
           next:=nil;
           next:=nil;