Fix bug in gen_load_cgpara_loc for 64bit registers on 8bit architectures.

Added a workaround in a_load_const_reg to allow compilation for AVR.

git-svn-id: trunk@32090 -
This commit is contained in:
Jeppe Johansen 2015-10-18 11:36:58 +00:00
parent 3fcbb7d2d4
commit 14020b044c
2 changed files with 7 additions and 2 deletions

View File

@ -968,7 +968,12 @@ unit cgcpu;
if ((qword(a) and mask) shr shift)=0 then
emit_mov(list,reg,NR_R1)
else
list.concat(taicpu.op_reg_const(A_LDI,reg,(qword(a) and mask) shr shift));
begin
getcpuregister(list,NR_R26);
list.concat(taicpu.op_reg_const(A_LDI,NR_R26,(qword(a) and mask) shr shift));
a_load_reg_reg(list,OS_8,OS_8,NR_R26,reg);
ungetcpuregister(list,NR_R26);
end;
mask:=mask shl 8;
inc(shift,8);

View File

@ -930,7 +930,7 @@ implementation
unget_para(curparaloc^.next^.next^);
cg.a_load_cgparaloc_anyreg(list,OS_8,curparaloc^.next^.next^,GetNextReg(GetNextReg(destloc.register64.reglo)),1);
unget_para(curparaloc^.next^.next^.next^);
cg.a_load_cgparaloc_anyreg(list,OS_8,curparaloc^.next^.next^,GetNextReg(GetNextReg(GetNextReg(destloc.register64.reglo))),1);
cg.a_load_cgparaloc_anyreg(list,OS_8,curparaloc^.next^.next^.next^,GetNextReg(GetNextReg(GetNextReg(destloc.register64.reglo))),1);
curparaloc:=paraloc^.next^.next^.next^.next;
unget_para(curparaloc^);