Sfoglia il codice sorgente

* don't coalescate with frame/stack pointer

git-svn-id: trunk@5880 -
florian 18 anni fa
parent
commit
36a500c38c
2 ha cambiato i file con 8 aggiunte e 3 eliminazioni
  1. 1 1
      compiler/x86/cgx86.pas
  2. 7 2
      compiler/x86_64/cgcpu.pas

+ 1 - 1
compiler/x86/cgx86.pas

@@ -746,7 +746,7 @@ 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. }
-            if (reg1<>NR_ESP) and (reg1<>NR_EBP) then
+            if (reg1<>current_procinfo.framepointer) and (reg1<>NR_STACK_POINTER_REG) then
               add_move_instruction(instr);
             list.concat(instr);
           end;

+ 7 - 2
compiler/x86_64/cgcpu.pas

@@ -59,6 +59,7 @@ unit cgcpu;
           RS_XMM8,RS_XMM9,RS_XMM10,RS_XMM11,RS_XMM12,RS_XMM13,RS_XMM14,RS_XMM15);
       var
         i : longint;
+        framepointer : tsuperregister;
       begin
         inherited init_register_allocators;
         if target_info.system=system_x86_64_win64 then
@@ -80,9 +81,13 @@ unit cgcpu;
             for i:=low(others_saved_std_regs) to high(others_saved_std_regs) do
               saved_standard_registers[i]:=others_saved_std_regs[i];
           end;
-
+        if assigned(current_procinfo) then
+          framepointer:=getsupreg(current_procinfo.framepointer) 
+        else
+          { in intf. wrapper code generation }
+          framepointer:=RS_FRAME_POINTER_REG;
         rg[R_INTREGISTER]:=trgcpu.create(R_INTREGISTER,R_SUBWHOLE,[RS_RAX,RS_RDX,RS_RCX,RS_RBX,RS_RSI,RS_RDI,
-          RS_R8,RS_R9,RS_R10,RS_R11,RS_R12,RS_R13,RS_R14,RS_R15],first_int_imreg,[RS_RBP]);
+          RS_R8,RS_R9,RS_R10,RS_R11,RS_R12,RS_R13,RS_R14,RS_R15],first_int_imreg,[framepointer]);
         rg[R_MMREGISTER]:=trgcpu.create(R_MMREGISTER,R_SUBWHOLE,[RS_XMM0,RS_XMM1,RS_XMM2,RS_XMM3,RS_XMM4,RS_XMM5,RS_XMM6,RS_XMM7,
           RS_XMM8,RS_XMM9,RS_XMM10,RS_XMM11,RS_XMM12,RS_XMM13,RS_XMM14,RS_XMM15],first_mm_imreg,[]);
         rgfpu:=Trgx86fpu.create;