Browse Source

use the whole reg for return values

git-svn-id: trunk@27116 -
Károly Balogh 11 years ago
parent
commit
73db4db6f8
1 changed files with 11 additions and 0 deletions
  1. 11 0
      compiler/m68k/cpupara.pas

+ 11 - 0
compiler/m68k/cpupara.pas

@@ -220,6 +220,17 @@ unit cpupara;
         if set_common_funcretloc_info(p,forcetempdef,retcgsize,result) then
         if set_common_funcretloc_info(p,forcetempdef,retcgsize,result) then
           exit;
           exit;
 
 
+        { always use the whole 32 bit register when returning values }
+        if (side=calleeside) and
+           (result.intsize>0) and
+           (result.intsize<sizeof(aint)) then
+          begin
+            result.def:=sinttype;
+            result.intsize:=sizeof(aint);
+            retcgsize:=OS_SINT;
+            result.size:=retcgsize;
+          end;
+
         paraloc:=result.add_location;
         paraloc:=result.add_location;
         { Return in FPU register? }
         { Return in FPU register? }
         if not (cs_fp_emulation in current_settings.moduleswitches) and
         if not (cs_fp_emulation in current_settings.moduleswitches) and