Browse Source

m68k: change the stack push order in the register calling convention to left-to-right. This should fix parameter handling in nested procedures (tnest5)

git-svn-id: trunk@47279 -
Károly Balogh 4 years ago
parent
commit
9d425ff4ca
1 changed files with 4 additions and 20 deletions
  1. 4 20
      compiler/m68k/cpupara.pas

+ 4 - 20
compiler/m68k/cpupara.pas

@@ -483,10 +483,7 @@ unit cpupara;
           pass all unhandled parameters are done }
           pass all unhandled parameters are done }
         for pass:=1 to 2 do
         for pass:=1 to 2 do
           begin
           begin
-            if pass=1 then
-              i:=0
-            else
-              i:=paras.count-1;
+            i:=0;
             while true do
             while true do
               begin
               begin
                 hp:=tparavarsym(paras[i]);
                 hp:=tparavarsym(paras[i]);
@@ -631,22 +628,9 @@ unit cpupara;
                             end;
                             end;
                         end;
                         end;
                   end;
                   end;
-                case pass of
-                  1:
-                    begin
-                      if i=paras.count-1 then
-                        break;
-                      inc(i);
-                    end;
-                  2:
-                    begin
-                      if i=0 then
-                        break;
-                      dec(i);
-                    end;
-                  else
-                    ;
-                end;
+                if i=paras.count-1 then
+                  break;
+                inc(i);
               end;
               end;
           end;
           end;
         result:=cur_stack_offset;
         result:=cur_stack_offset;