diff --git a/compiler/m68k/n68kcnv.pas b/compiler/m68k/n68kcnv.pas index ce2c06a262..1375b4dbb4 100644 --- a/compiler/m68k/n68kcnv.pas +++ b/compiler/m68k/n68kcnv.pas @@ -135,6 +135,8 @@ implementation internalerror(20020814); location.register:=cg.getfpuregister(current_asmdata.CurrAsmList,opsize); + if not(left.location.loc in [LOC_REGISTER,LOC_CREGISTER,LOC_REFERENCE,LOC_CREFERENCE]) then + location_force_reg(current_asmdata.CurrAsmList,left.location,OS_INT,false); case left.location.loc of LOC_REGISTER, LOC_CREGISTER: begin diff --git a/compiler/powerpc/nppccnv.pas b/compiler/powerpc/nppccnv.pas index f8f69d41ea..cefa46883d 100644 --- a/compiler/powerpc/nppccnv.pas +++ b/compiler/powerpc/nppccnv.pas @@ -169,7 +169,7 @@ implementation internalerror(200110011); if not(left.location.loc in [LOC_REGISTER,LOC_CREGISTER,LOC_REFERENCE,LOC_CREFERENCE]) then - location_force_reg(current_asmdata.CurrAsmList,left.location,OS_INT,false); + location_force_reg(current_asmdata.CurrAsmList,left.location,left.location.size,false); case left.location.loc of LOC_REGISTER: begin diff --git a/compiler/powerpc64/nppccnv.pas b/compiler/powerpc64/nppccnv.pas index d62cf2d4c8..363251176d 100644 --- a/compiler/powerpc64/nppccnv.pas +++ b/compiler/powerpc64/nppccnv.pas @@ -149,7 +149,7 @@ begin end; if not(left.location.loc in [LOC_REGISTER,LOC_CREGISTER,LOC_REFERENCE,LOC_CREFERENCE]) then - location_force_reg(current_asmdata.CurrAsmList,left.location,OS_INT,false); + location_force_reg(current_asmdata.CurrAsmList,left.location,left.location.size,false); case left.location.loc of // the conversion algorithm does not modify the input register, so it can // be used for both LOC_REGISTER and LOC_CREGISTER diff --git a/compiler/x86/nx86cnv.pas b/compiler/x86/nx86cnv.pas index 969677e880..ed875051db 100644 --- a/compiler/x86/nx86cnv.pas +++ b/compiler/x86/nx86cnv.pas @@ -205,6 +205,9 @@ implementation hreg : tregister; op : tasmop; begin + if (left.location.loc in [LOC_SUBSETREG,LOC_CSUBSETREG,LOC_SUBSETREF,LOC_CSUBSETREF]) then + location_force_reg(current_asmdata.CurrAsmList,left.location,left.location.size,true); + {$ifdef x86_64} if use_sse(resultdef) then begin @@ -226,9 +229,6 @@ implementation location_reset(location,LOC_MMREGISTER,def_cgsize(resultdef)); location.register:=cg.getmmregister(current_asmdata.CurrAsmList,def_cgsize(resultdef)); - if (left.location.loc in [LOC_SUBSETREG,LOC_CSUBSETREG,LOC_SUBSETREF,LOC_CSUBSETREF]) then - location_force_reg(current_asmdata.CurrAsmList,left.location,left.location.size,true); - case torddef(left.resultdef).ordtype of u64bit: begin