Pārlūkot izejas kodu

* i8086 parameter alignment fixes

git-svn-id: branches/i8086@23978 -
nickysn 12 gadi atpakaļ
vecāks
revīzija
af5614e52d

+ 1 - 1
compiler/i8086/cgcpu.pas

@@ -374,7 +374,7 @@ unit cgcpu;
                     if cgpara.location^.Next^.Next <> nil then
                       internalerror(2013031101);
                   end;
-                if cgpara.alignment <> 4 then
+                if (cgpara.alignment <> 4) and (cgpara.alignment <> 2) then
                   internalerror(2013031101);
 
                 list.concat(taicpu.op_const(A_PUSH,S_W,a shr 16));

+ 1 - 1
compiler/i8086/cpubase.inc

@@ -146,4 +146,4 @@
          The value of this constant is equal to the constant
          PARM_BOUNDARY / BITS_PER_UNIT in the GCC source.
       }
-      std_param_align = 4;
+      std_param_align = 2;

+ 1 - 9
compiler/i8086/cpupara.pas

@@ -237,15 +237,7 @@ unit cpupara;
 
     function ti8086paramanager.get_para_align(calloption : tproccalloption):byte;
       begin
-        if calloption=pocall_oldfpccall then
-          begin
-            if target_info.system in [system_i386_go32v2,system_i386_watcom] then
-              result:=2
-            else
-              result:=4;
-          end
-        else
-          result:=std_param_align;
+        result:=std_param_align;
       end;
 
 

+ 4 - 3
compiler/i8086/cpupi.pas

@@ -74,10 +74,11 @@ unit cpupi;
 
     function ti8086procinfo.calc_stackframe_size:longint;
       begin
-        { align to 4 bytes at least
+        { ???:
+          align to 4 bytes at least
           otherwise all those subl $2,%esp are meaningless PM }
-        if target_info.stackalign<=4 then
-          result:=Align(tg.direction*tg.lasttemp,min(current_settings.alignment.localalignmax,4))
+        if target_info.stackalign<=2 then
+          result:=Align(tg.direction*tg.lasttemp,min(current_settings.alignment.localalignmax,2))
         else
           { aligned during stack frame allocation, because also depends number
             of saved registers }