Ver código fonte

* CallRet2* optimization may not misalign the stack, reported by C Western on fpc-devel

git-svn-id: trunk@44253 -
florian 5 anos atrás
pai
commit
34be9e4643
1 arquivos alterados com 4 adições e 1 exclusões
  1. 4 1
      compiler/x86/aoptx86.pas

+ 4 - 1
compiler/x86/aoptx86.pas

@@ -176,6 +176,7 @@ unit aoptx86;
 
     uses
       cutils,verbose,
+      systems,
       globals,
       cpuinfo,
       procinfo,
@@ -5902,7 +5903,9 @@ unit aoptx86;
           MatchInstruction(hp1,A_RET,[S_NO]) and
           (taicpu(hp1).ops=0) then
           begin
-            if cs_opt_level4 in current_settings.optimizerswitches then
+            if (cs_opt_level4 in current_settings.optimizerswitches) and
+              { we might destroy stack alignment here if we do not do a call }
+              (target_info.stackalign<=sizeof(SizeUInt)) then
               begin
                 taicpu(p).opcode := A_JMP;
                 taicpu(p).is_jmp := true;