* when a function returns a value in a register, but normally that type

would never be put in that kind of register by the compiler, store
    it to memory to avoid issues down the line
   o fixes tcalext6 on darwin/i386

git-svn-id: trunk@46449 -
This commit is contained in:
Jonas Maebe 2020-08-15 15:13:08 +00:00
parent ad7c3d9a09
commit cc14f06677

View File

@ -623,6 +623,18 @@ implementation
assigned(funcretnode) then
hlcg.gen_load_cgpara_loc(current_asmdata.CurrAsmList,realresdef,retloc,location,false);
if ((location.loc=LOC_REGISTER) and
not realresdef.is_intregable) or
((location.loc in [LOC_FPUREGISTER,LOC_MMREGISTER]) and
(not realresdef.is_fpuregable or
((location.loc=LOC_MMREGISTER)<>use_vectorfpu(realresdef)))) then
begin
hlcg.location_force_mem(current_asmdata.CurrAsmList,location,realresdef);
{ may have been record returned in a floating point register (-> location.size
will be the size of the fpuregister instead of the int size of the record) }
location.size:=def_cgsize(realresdef);
end;
{ copy value to the final location if this was already provided to the
callnode. This must be done after the call node, because the location can
also be used as parameter and may not be finalized yet }