Kaynağa Gözat

Merged revisions 6502 via svnmerge from
svn+ssh://[email protected]/FPC/svn/fpc/trunk

........
r6502 | jonas | 2007-02-15 22:12:44 +0100 (Thu, 15 Feb 2007) | 2 lines

* r6498 for ppc64

........

git-svn-id: branches/fpc_2_3@6503 -

Jonas Maebe 18 yıl önce
ebeveyn
işleme
70f57c89ee
2 değiştirilmiş dosya ile 12 ekleme ve 4 silme
  1. 4 2
      compiler/powerpc64/cgcpu.pas
  2. 8 2
      compiler/powerpc64/cpupi.pas

+ 4 - 2
compiler/powerpc64/cgcpu.pas

@@ -1463,7 +1463,8 @@ begin
   end;
 
   { create stack frame }
-  if (not nostackframe) and (localsize > 0) then begin
+  if (not nostackframe) and (localsize > 0) and
+     tppcprocinfo(current_procinfo).needstackframe then begin
     if (localsize <= high(smallint)) then begin
       reference_reset_base(href, NR_STACK_POINTER_REG, -localsize);
       a_load_store(list, A_STDU, NR_STACK_POINTER_REG, href);
@@ -1592,7 +1593,8 @@ begin
   { CR register not supported }
 
   { restore stack pointer }
-  if (not nostackframe) and (localsize > 0) then begin
+  if (not nostackframe) and (localsize > 0) and
+    tppcprocinfo(current_procinfo).needstackframe then begin
     if (localsize <= high(smallint)) then begin
       list.concat(taicpu.op_reg_reg_const(A_ADDI, NR_STACK_POINTER_REG, NR_STACK_POINTER_REG, localsize));
     end else begin

+ 8 - 2
compiler/powerpc64/cpupi.pas

@@ -33,6 +33,8 @@ uses
 
 type
   tppcprocinfo = class(tcgprocinfo)
+    needstackframe: boolean;
+
     { offset where the frame pointer from the outer procedure is stored. }
     parent_framepointer_offset: longint;
     constructor create(aparent: tprocinfo); override;
@@ -100,9 +102,13 @@ begin
     if (pi_do_call in flags) or (tg.lasttemp <> tg.firsttemp) or
       (result > RED_ZONE_SIZE) {or (cs_profile in init_settings.moduleswitches)} then begin
       result := align(result + tg.lasttemp, ELF_STACK_ALIGN);
-    end;
-  end else
+      needstackframe:=true;
+    end else
+      needstackframe:=false;
+  end else begin
     result := align(tg.lasttemp, ELF_STACK_ALIGN);
+    needstackframe:=result<>0;
+  end;
 end;
 
 begin