Browse Source

word alignement modified in g_stack_frame

mazen 23 years ago
parent
commit
a15b375214
2 changed files with 29 additions and 24 deletions
  1. 5 4
      compiler/sparc/cgcpu.pas
  2. 24 20
      compiler/sparc/cpupara.pas

+ 5 - 4
compiler/sparc/cgcpu.pas

@@ -838,9 +838,7 @@ stack frame.}
 {Althogh the SPARC architecture require only word alignment, software
 {Althogh the SPARC architecture require only word alignment, software
 convention and the operating system require every stack frame to be double word
 convention and the operating system require every stack frame to be double word
 aligned}
 aligned}
-		if(LocalSize and $00000003)<>0
-		then
-			LocalSize:=(LocalSize and $FFFFFFFC)+4;
+		LocalSize:=(LocalSize+3)and $FFFFFFFC;
 {Execute the SAVE instruction to get a new register window and get a new stack
 {Execute the SAVE instruction to get a new register window and get a new stack
 frame. In the "SAVE %i6,size,%i6" the first %i6 is related to the state before
 frame. In the "SAVE %i6,size,%i6" the first %i6 is related to the state before
 execution of the SAVE instrucion so it is the caller %i6, when the %i6 after
 execution of the SAVE instrucion so it is the caller %i6, when the %i6 after
@@ -1135,7 +1133,10 @@ BEGIN
 END.
 END.
 {
 {
   $Log$
   $Log$
-  Revision 1.10  2002-10-04 21:57:42  mazen
+  Revision 1.11  2002-10-07 20:33:04  mazen
+  word alignement modified in g_stack_frame
+
+  Revision 1.10  2002/10/04 21:57:42  mazen
   * register allocation for parameters now done in cpupara, but InternalError(200109223) in cgcpu.pas:1053 is still not fixed du to location_force problem in ncgutils.pas:419
   * register allocation for parameters now done in cpupara, but InternalError(200109223) in cgcpu.pas:1053 is still not fixed du to location_force problem in ncgutils.pas:419
 
 
   Revision 1.9  2002/10/02 22:20:28  mazen
   Revision 1.9  2002/10/02 22:20:28  mazen

+ 24 - 20
compiler/sparc/cpupara.pas

@@ -46,25 +46,26 @@ uses
 	globtype,
 	globtype,
 	cpuinfo,cginfo,cgbase,
 	cpuinfo,cginfo,cgbase,
 	defbase;
 	defbase;
-
-    function tSparcparamanager.getintparaloc(nr : longint) : tparalocation;
-
-      begin
-         fillchar(result,sizeof(tparalocation),0);
-         if nr<1 then
-           internalerror(2002070801)
-         else if nr<=8 then
-           begin
-              result.loc:=LOC_REGISTER;
-              result.register:=tregister(longint(R_O0)+nr);
-           end
-         else
-           begin
-              result.loc:=LOC_REFERENCE;
-              result.reference.index:=stack_pointer_reg;
-              result.reference.offset:=(nr-8)*4;
-           end;
-      end;
+function TSparcParaManager.getintparaloc(nr:longint):TParaLocation;
+	begin
+		FillChar(result,SizeOf(TParaLocation),0);
+		with Result do
+			if nr<1
+			then
+				InternalError(2002070801)
+			else if nr<=8
+			then
+				begin
+					loc:=LOC_REGISTER;
+					register:=tregister(longint(R_O0)+nr);
+				end
+			else
+				begin
+					loc:=LOC_REFERENCE;
+					reference.index:=stack_pointer_reg;
+					reference.offset:=(nr-8)*4;
+				end;
+	end;
 
 
     function getparaloc(p : tdef) : tloc;
     function getparaloc(p : tdef) : tloc;
 
 
@@ -295,7 +296,10 @@ BEGIN
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.2  2002-10-04 21:57:42  mazen
+  Revision 1.3  2002-10-07 20:33:05  mazen
+  word alignement modified in g_stack_frame
+
+  Revision 1.2  2002/10/04 21:57:42  mazen
   * register allocation for parameters now done in cpupara, but InternalError(200109223) in cgcpu.pas:1053 is still not fixed du to location_force problem in ncgutils.pas:419
   * register allocation for parameters now done in cpupara, but InternalError(200109223) in cgcpu.pas:1053 is still not fixed du to location_force problem in ncgutils.pas:419
 
 
   Revision 1.1  2002/08/21 13:30:07  mazen
   Revision 1.1  2002/08/21 13:30:07  mazen