From 4c2b412613f1b4d1c35ce8f257c3676cf5be6a35 Mon Sep 17 00:00:00 2001 From: florian Date: Sat, 2 Dec 2006 15:36:32 +0000 Subject: [PATCH] * x86_64-win64 returns structured types up to 8 bytes in rax git-svn-id: trunk@5528 - --- compiler/ncgutil.pas | 2 +- compiler/x86_64/cpupara.pas | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/compiler/ncgutil.pas b/compiler/ncgutil.pas index b097063a4d..b174eca0c1 100644 --- a/compiler/ncgutil.pas +++ b/compiler/ncgutil.pas @@ -1381,7 +1381,7 @@ implementation if paramanager.ret_in_param(current_procinfo.procdef.returndef,current_procinfo.procdef.proccalloption) then cg.a_load_loc_reg(list,OS_ADDR,restmploc,hreg) else - cg.a_load_loc_reg(list,restmploc.size,restmploc,hreg); + cg.a_load_loc_reg(list,restmploc.size,restmploc,hreg); end; end; LOC_FPUREGISTER: diff --git a/compiler/x86_64/cpupara.pas b/compiler/x86_64/cpupara.pas index 53c6530339..762f8c66f5 100644 --- a/compiler/x86_64/cpupara.pas +++ b/compiler/x86_64/cpupara.pas @@ -169,11 +169,10 @@ unit cpupara; function tx86_64paramanager.ret_in_param(def : tdef;calloption : tproccalloption) : boolean; - var - size: longint; begin - if (target_info.system=system_x86_64_win64) and (calloption=pocall_safecall) then - result:=true + if target_info.system=system_x86_64_win64 then + result:=(calloption=pocall_safecall) or + not(def.size in [1,2,4,8]) else result:=inherited ret_in_param(def,calloption); end; @@ -314,7 +313,6 @@ unit cpupara; retcgsize:=OS_ADDR else retcgsize:=def_cgsize(p.returndef); - location_reset(p.funcretloc[side],LOC_INVALID,OS_NO); { void has no location } if is_void(p.returndef) then