Browse Source

+ computed_local_size new longint field in TMIPSProcInfo
to check that LocalSize stays constant.

New function mips_extra_offset (needed for stabs debugging)

git-svn-id: trunk@21585 -

pierre 13 years ago
parent
commit
550bbb0186
1 changed files with 22 additions and 2 deletions
  1. 22 2
      compiler/mips/cpupi.pas

+ 22 - 2
compiler/mips/cpupi.pas

@@ -27,7 +27,7 @@ interface
 
 
   uses
   uses
     cutils,
     cutils,
-    globtype,
+    globtype,symdef,
     procinfo,cpuinfo,cpupara,
     procinfo,cpuinfo,cpupara,
     psub;
     psub;
 
 
@@ -42,15 +42,20 @@ interface
       floatregssave : byte;
       floatregssave : byte;
       register_used : tparasupregsused;
       register_used : tparasupregsused;
       register_offset : tparasupregsoffset;
       register_offset : tparasupregsoffset;
+      computed_local_size : longint;
       constructor create(aparent:tprocinfo);override;
       constructor create(aparent:tprocinfo);override;
       function calc_stackframe_size:longint;override;
       function calc_stackframe_size:longint;override;
       procedure set_first_temp_offset;override;
       procedure set_first_temp_offset;override;
     end;
     end;
 
 
+   { Used by Stabs debug info generator }
+
+   function mips_extra_offset(procdef : tprocdef) : longint;
+
 implementation
 implementation
 
 
     uses
     uses
-      systems,globals,
+      systems,globals,verbose,
       cpubase,cgbase,cgobj,
       cpubase,cgbase,cgobj,
       tgobj,paramgr,symconst;
       tgobj,paramgr,symconst;
 
 
@@ -67,6 +72,7 @@ implementation
 
 
         floatregssave:=11;
         floatregssave:=11;
         intregssave:=10;
         intregssave:=10;
+        computed_local_size:=-1;
       end;
       end;
 
 
 
 
@@ -93,8 +99,22 @@ implementation
         intregstart:=result;
         intregstart:=result;
         inc(result,intregssave*4);
         inc(result,intregssave*4);
         result:=Align(tg.lasttemp,max(current_settings.alignment.localalignmin,8));
         result:=Align(tg.lasttemp,max(current_settings.alignment.localalignmin,8));
+        if computed_local_size=-1 then
+          begin
+            computed_local_size:=result;
+            procdef.total_local_size:=result;
+          end
+        else if computed_local_size <> result then
+          Comment(V_Warning,'TMIPSProcInfo.calc_stackframe_size result changed');
       end;
       end;
 
 
+    function mips_extra_offset(procdef : tprocdef) : longint;
+      begin
+        if procdef=nil then
+          mips_extra_offset:=0
+        else
+          mips_extra_offset:=procdef.total_local_size;
+      end;
 
 
 begin
 begin
   cprocinfo:=TMIPSProcInfo;
   cprocinfo:=TMIPSProcInfo;