Browse Source

* avoid esp to be freed

git-svn-id: trunk@2203 -
florian 19 years ago
parent
commit
a3e3e7e8c5
1 changed files with 2 additions and 2 deletions
  1. 2 2
      compiler/x86/cgx86.pas

+ 2 - 2
compiler/x86/cgx86.pas

@@ -706,7 +706,8 @@ unit cgx86;
             instr:=taicpu.op_reg_reg(op,s,reg1,reg2);
             { Notify the register allocator that we have written a move instruction so
               it can try to eliminate it. }
-            add_move_instruction(instr);
+            if reg1<>NR_ESP then
+              add_move_instruction(instr);
             list.concat(instr);
           end;
 {$ifdef x86_64}
@@ -1844,7 +1845,6 @@ unit cgx86;
               CGmessage(cg_d_stackframe_omited)
             else
               begin
-
                 include(rg[R_INTREGISTER].preserved_by_proc,RS_FRAME_POINTER_REG);
                 list.concat(Taicpu.op_reg(A_PUSH,tcgsize2opsize[OS_ADDR],NR_FRAME_POINTER_REG));
                 { Return address and FP are both on stack }