Explorar o código

m68k: revert the r36568 and the followup fix attempts altogether, as they broke Amiga support entirely. there will be a cleanup before another fixing attempt

git-svn-id: trunk@36598 -
Károly Balogh %!s(int64=8) %!d(string=hai) anos
pai
achega
22ae3cd186
Modificáronse 2 ficheiros con 7 adicións e 13 borrados
  1. 2 6
      compiler/m68k/cgcpu.pas
  2. 5 7
      compiler/m68k/cpupara.pas

+ 2 - 6
compiler/m68k/cgcpu.pas

@@ -372,7 +372,6 @@ unit cgcpu;
 
       var
         len : tcgint;
-        ofs : tcgint;
         href : treference;
       begin
         { cgpara.size=OS_NO requires a copy on the stack }
@@ -385,11 +384,8 @@ unit cgcpu;
                 cgpara.check_simple_location;
                 len:=align(cgpara.intsize,cgpara.alignment);
                 g_stackpointer_alloc(list,len);
-                ofs:=0;
-                if cgpara.intsize<target_info.stackalign then
-                  ofs:=target_info.stackalign-cgpara.intsize;
-                reference_reset_base(href,NR_STACK_POINTER_REG,ofs,cgpara.alignment,[]);
-                g_concatcopy(list,r,href,cgpara.intsize);
+                reference_reset_base(href,NR_STACK_POINTER_REG,0,cgpara.alignment,[]);
+                g_concatcopy(list,r,href,len);
               end
             else
               begin

+ 5 - 7
compiler/m68k/cpupara.pas

@@ -387,10 +387,10 @@ unit cpupara;
                   begin
                     paraloc^.reference.index:=NR_FRAME_POINTER_REG;
                     inc(paraloc^.reference.offset,target_info.first_parm_offset);
+                    { M68K is a big-endian target }
+                    if (paralen<target_info.stackalign{tcgsize2size[OS_INT]}) then
+                      inc(paraloc^.reference.offset,target_info.stackalign-paralen);
                   end;
-                { M68K is a big-endian target }
-                if (paralen<target_info.stackalign{tcgsize2size[OS_INT]}) then
-                  inc(paraloc^.reference.offset,target_info.stackalign-paralen);
                 inc(cur_stack_offset,align(paralen,target_info.stackalign));
                 paralen := 0;
 
@@ -535,8 +535,6 @@ unit cpupara;
                               paraloc^.reference.offset:=cur_stack_offset;
                               if side=calleeside then
                                 inc(paraloc^.reference.offset,target_info.first_parm_offset);
-                              if (paralen<target_info.stackalign) then
-                                inc(paraloc^.reference.offset,varalign-paralen);
                               cur_stack_offset:=align(cur_stack_offset+paralen,varalign);
                             end
                           else
@@ -577,8 +575,8 @@ unit cpupara;
                                   varalign:=used_align(size_2_align(l),paraalign,paraalign);
                                   paraloc^.reference.offset:=cur_stack_offset;
                                   { M68K is a big-endian target }
-                                  if (l<target_info.stackalign) then
-                                    inc(paraloc^.reference.offset,varalign-l);
+                                  if (paralen<tcgsize2size[OS_INT]) then
+                                    inc(paraloc^.reference.offset,4-paralen);
                                   if side=calleeside then
                                     inc(paraloc^.reference.offset,target_info.first_parm_offset);
                                   cur_stack_offset:=align(cur_stack_offset+l,varalign);