Bläddra i källkod

* also align esp for all procedures/functions declared "assembler",
since they may do a call. If you don't want that to happen, use
the nostackframe directive (i386-darwin only)

git-svn-id: trunk@2896 -

Jonas Maebe 19 år sedan
förälder
incheckning
9125d0c189
2 ändrade filer med 6 tillägg och 2 borttagningar
  1. 4 1
      compiler/i386/cgcpu.pas
  2. 2 1
      compiler/x86/cgx86.pas

+ 4 - 1
compiler/i386/cgcpu.pas

@@ -262,7 +262,10 @@ unit cgcpu;
                 stacksize:=current_procinfo.calc_stackframe_size;
                 if (target_info.system = system_i386_darwin) and
                    ((stacksize <> 0) or
-                    (pi_do_call in current_procinfo.flags)) then
+                    (pi_do_call in current_procinfo.flags) or
+                    { can't detect if a call in this case -> use nostackframe }
+                    { if you (think you) know what you are doing              }
+                    (po_assembler in current_procinfo.procdef.procoptions)) then
                   stacksize := align(stacksize+sizeof(aint),16) - sizeof(aint);
                 if (stacksize<>0) then
                   cg.a_op_const_reg(list,OP_ADD,OS_ADDR,stacksize,current_procinfo.framepointer);

+ 2 - 1
compiler/x86/cgx86.pas

@@ -1911,7 +1911,8 @@ unit cgx86;
             if (localsize<>0) or
                ((target_info.system = system_i386_darwin) and
                 (stackmisalignment <> 0) and
-                (pi_do_call in current_procinfo.flags)) then
+                ((pi_do_call in current_procinfo.flags) or
+                 (po_assembler in current_procinfo.procdef.procoptions))) then
               begin
                 if (target_info.system = system_i386_darwin) then
                   localsize := align(localsize+stackmisalignment,16)-stackmisalignment;