Pārlūkot izejas kodu

* some fixes for handling parameters passed on the stack

git-svn-id: trunk@30545 -
florian 10 gadi atpakaļ
vecāks
revīzija
1ef7e36f3c
2 mainītis faili ar 11 papildinājumiem un 15 dzēšanām
  1. 8 9
      compiler/avr/cgcpu.pas
  2. 3 6
      compiler/avr/cpupara.pas

+ 8 - 9
compiler/avr/cgcpu.pas

@@ -313,24 +313,23 @@ unit cgcpu;
 
         for i:=1 to tcgsize2size[paraloc.Size] do
           begin
-            if not(assigned(hp)) or
-              (tcgsize2size[hp^.size]<>1) or
-              (hp^.shiftval<>0) then
+            if not(assigned(hp)) then
               internalerror(2014011105);
              case hp^.loc of
                LOC_REGISTER,LOC_CREGISTER:
-                 a_load_const_reg(list,hp^.size,(a shr (8*(i-1))) and $ff,hp^.register);
-               LOC_REFERENCE,LOC_CREFERENCE:
                  begin
-                   list.concat(taicpu.op_const(A_PUSH,(a shr (8*(i-1))) and $ff));
+                   if (tcgsize2size[hp^.size]<>1) or
+                     (hp^.shiftval<>0) then
+                     internalerror(2015041101);
+                   a_load_const_reg(list,hp^.size,(a shr (8*(i-1))) and $ff,hp^.register);
+                   hp:=hp^.Next;
                  end;
+               LOC_REFERENCE,LOC_CREFERENCE:
+                 list.concat(taicpu.op_const(A_PUSH,(a shr (8*(i-1))) and $ff));
                else
                  internalerror(2002071004);
             end;
-            hp:=hp^.Next;
           end;
-        if assigned(hp) then
-          internalerror(2014011104);
       end;
 
 

+ 3 - 6
compiler/avr/cpupara.pas

@@ -324,11 +324,6 @@ unit cpupara;
                      else
                        internalerror(2005082901);
                    end
-                 else if paracgsize<>OS_S8 then
-                   begin
-                     paraloc^.size:=OS_8;
-                     paraloc^.def:=u8inttype
-                   end
                  else
                    begin
                      paraloc^.size:=paracgsize;
@@ -340,6 +335,8 @@ unit cpupara;
                         if nextintreg>=RS_R8 then
                           begin
                             paraloc^.loc:=LOC_REGISTER;
+                            paraloc^.size:=OS_8;
+                            paraloc^.def:=u8inttype;
                             paraloc^.register:=newreg(R_INTREGISTER,nextintreg,R_SUBWHOLE);
                             inc(nextintreg);
                           end
@@ -349,9 +346,9 @@ unit cpupara;
                       end;
                     LOC_REFERENCE:
                       begin
-                        paraloc^.size:=OS_ADDR;
                         if push_addr_param(hp.varspez,paradef,p.proccalloption) then
                           begin
+                            paraloc^.size:=OS_ADDR;
                             paraloc^.def:=getpointerdef(paradef);
                             assignintreg
                           end