* fixed generic code for subtracting one set from another if both are

in registers, because the left set could be overwritten before its
    last use

git-svn-id: trunk@18792 -
This commit is contained in:
Jonas Maebe 2011-08-20 20:36:13 +00:00
parent bf74f2efee
commit 1bb9a3b3d7

View File

@ -303,6 +303,13 @@ interface
if (right.location.size<>left.location.size) or
(location.size<>left.location.size) then
internalerror(2010123001);
{ make sure that location.register is different from
left.location.register, since right will overwrite it
and we'll use left afterwards }
if (right.location.loc=LOC_REGISTER) then
location.register:=right.location.register
else
location.register:=cg.getintregister(current_asmdata.CurrAsmList,location.size);
{ make sure we don't modify left/right.location, because we told
force_reg_left_right above that they can be constant }
cg.a_op_reg_reg(current_asmdata.CurrAsmList,OP_NOT,location.size,right.location.register,location.register);