Sfoglia il codice sorgente

* patch by Jeppe Johanse to take care of the fact that push is post-decrement on avr

git-svn-id: trunk@30548 -
florian 10 anni fa
parent
commit
e34bd746ed
1 ha cambiato i file con 5 aggiunte e 3 eliminazioni
  1. 5 3
      compiler/avr/cpupi.pas

+ 5 - 3
compiler/avr/cpupi.pas

@@ -56,7 +56,9 @@ unit cpupi;
     procedure tavrprocinfo.set_first_temp_offset;
       begin
         if tg.direction = -1 then
-          tg.setfirsttemp(0)
+          tg.setfirsttemp(-1)
+        else if not (po_nostackframe in procdef.procoptions) then
+          tg.setfirsttemp(maxpushedparasize+1)
         else
           tg.setfirsttemp(maxpushedparasize);
       end;
@@ -64,8 +66,8 @@ unit cpupi;
 
     function tavrprocinfo.calc_stackframe_size:longint;
       begin
-        maxpushedparasize:=align(maxpushedparasize,max(current_settings.alignment.localalignmin,4));
-        result:=Align(tg.direction*tg.lasttemp,max(current_settings.alignment.localalignmin,4))+maxpushedparasize;
+        maxpushedparasize:=align(maxpushedparasize,max(current_settings.alignment.localalignmin,2));
+        result:=Align(tg.direction*tg.lasttemp,max(current_settings.alignment.localalignmin,2))+maxpushedparasize;
       end;