m68k: before doing a reg->ref operation, make sure the source is a datareg

git-svn-id: trunk@30189 -
This commit is contained in:
Károly Balogh 2015-03-14 16:36:02 +00:00
parent 52e505bff7
commit 1121c2e6ce

View File

@ -1378,6 +1378,7 @@ unit cgcpu;
opcode : tasmop;
opsize : topsize;
href : treference;
hreg : tregister;
begin
opcode := topcg2tasmop[op];
opsize := TCGSize2OpSize[size];
@ -1396,8 +1397,10 @@ unit cgcpu;
begin
href:=ref;
fixref(list,href);
{ areg -> ref arithmetic operations are impossible on 68k }
hreg:=force_to_dataregister(list,size,reg);
{ add/sub works the same way, so have it unified here }
list.concat(taicpu.op_reg_ref(opcode, opsize, reg, href));
list.concat(taicpu.op_reg_ref(opcode, opsize, hreg, href));
end;
else begin
// list.concat(tai_comment.create(strpnew('a_op_reg_ref inherited')));