소스 검색

* fix crash in debug output in TX86AsmOptimizer.DoArithCombineOpt for DEC/INC $reg

Sven/Sarah Barth 2 년 전
부모
커밋
a2789d611f
1개의 변경된 파일10개의 추가작업 그리고 4개의 파일을 삭제
  1. 10 4
      compiler/x86/aoptx86.pas

+ 10 - 4
compiler/x86/aoptx86.pas

@@ -5956,10 +5956,16 @@ unit aoptx86;
               end
             else
               begin
-                DebugMsg(SPeepholeOptimization + 'Arithmetic combine: ' +
-                  debug_op2str(taicpu(hp1).opcode) + ' $' + debug_tostr(taicpu(hp1).oper[0]^.val) + ',' + debug_operstr(taicpu(hp1).oper[1]^) + '; ' +
-                  debug_op2str(taicpu(p).opcode) + ' $' + debug_tostr(taicpu(p).oper[0]^.val) + ',' + debug_operstr(taicpu(p).oper[1]^) + ' -> ' +
-                  debug_op2str(taicpu(p).opcode) + ' $' + debug_tostr(ThisConst) + ' ' + debug_operstr(taicpu(p).oper[1]^), p);
+                if taicpu(hp1).opercnt=1 then
+                  DebugMsg(SPeepholeOptimization + 'Arithmetic combine: ' +
+                    debug_op2str(taicpu(hp1).opcode) + ' $' + debug_tostr(taicpu(hp1).oper[0]^.val) + '; ' +
+                    debug_op2str(taicpu(p).opcode) + ' $' + debug_tostr(taicpu(p).oper[0]^.val) + ',' + debug_operstr(taicpu(p).oper[1]^) + ' -> ' +
+                    debug_op2str(taicpu(p).opcode) + ' $' + debug_tostr(ThisConst) + ' ' + debug_operstr(taicpu(p).oper[1]^), p)
+                else
+                  DebugMsg(SPeepholeOptimization + 'Arithmetic combine: ' +
+                    debug_op2str(taicpu(hp1).opcode) + ' $' + debug_tostr(taicpu(hp1).oper[0]^.val) + ',' + debug_operstr(taicpu(hp1).oper[1]^) + '; ' +
+                    debug_op2str(taicpu(p).opcode) + ' $' + debug_tostr(taicpu(p).oper[0]^.val) + ',' + debug_operstr(taicpu(p).oper[1]^) + ' -> ' +
+                    debug_op2str(taicpu(p).opcode) + ' $' + debug_tostr(ThisConst) + ' ' + debug_operstr(taicpu(p).oper[1]^), p);
 
                 taicpu(p).loadconst(0, ThisConst);
               end;