* fix loading of constants in registers in the LLVM CG if the constant

does not fit in ptrsinttype

git-svn-id: trunk@41138 -
This commit is contained in:
Jonas Maebe 2019-01-29 21:39:26 +00:00
parent 2d01fe76f6
commit e52cf555ab

View File

@ -553,8 +553,14 @@ implementation
procedure thlcgllvm.a_load_const_reg(list: TAsmList; tosize: tdef; a: tcgint; register: tregister);
var
fromsize: tdef;
begin
list.concat(taillvm.op_reg_size_const_size(llvmconvop(ptrsinttype,tosize,false),register,ptrsinttype,a,tosize))
if tosize.size<=ptrsinttype.size then
fromsize:=ptrsinttype
else
fromsize:=tosize;
list.concat(taillvm.op_reg_size_const_size(llvmconvop(fromsize,tosize,false),register,fromsize,a,tosize))
end;