浏览代码

* CallRet2Jmp works with PIC

git-svn-id: trunk@43371 -
florian 5 年之前
父节点
当前提交
6842c5784d
共有 1 个文件被更改,包括 1 次插入4 次删除
  1. 1 4
      compiler/x86/aoptx86.pas

+ 1 - 4
compiler/x86/aoptx86.pas

@@ -4244,19 +4244,16 @@ unit aoptx86;
           by
             jmp    procname
 
-          this should never hurt except when pic is used, not sure
-          how to handle it then
-
           but do it only on level 4 because it destroys stack back traces
         }
         if (cs_opt_level4 in current_settings.optimizerswitches) and
-          not(cs_create_pic in current_settings.moduleswitches) and
           GetNextInstruction(p, hp1) and
           MatchInstruction(hp1,A_RET,[S_NO]) and
           (taicpu(hp1).ops=0) then
           begin
             taicpu(p).opcode := A_JMP;
             taicpu(p).is_jmp := true;
+            DebugMsg(SPeepholeOptimization + 'CallRet2Jmp done',p);
             asml.remove(hp1);
             hp1.free;
             Result:=true;