--- Merging r43504 into '.':

U    compiler/nmat.pas
--- Recording mergeinfo for merge of r43504 into '.':
 U   .

git-svn-id: branches/fixes_3_2@43505 -
This commit is contained in:
Jonas Maebe 2019-11-16 17:58:36 +00:00
parent d201755ba2
commit afa7c478a2
2 changed files with 20 additions and 6 deletions

View File

@ -706,17 +706,31 @@ implementation
if is_constintnode(left) then if is_constintnode(left) then
begin begin
lvalue:=tordconstnode(left).value; lvalue:=tordconstnode(left).value;
{ shl/shr are unsigned operations, so cut off upper bits }
case resultdef.size of
1:
lvalue:=lvalue and byte($ff);
2:
lvalue:=lvalue and word($ffff);
4:
lvalue:=lvalue and dword($ffffffff);
8:
lvalue:=lvalue and qword($ffffffffffffffff);
else
internalerror(2013122301);
end;
case nodetype of case nodetype of
shrn: shrn:
lvalue:=tordconstnode(left).value shr rvalue; lvalue:=lvalue shr rvalue;
shln: shln:
lvalue:=tordconstnode(left).value shl rvalue; lvalue:=lvalue shl rvalue;
else else
internalerror(2019050517); internalerror(2019050517);
end; end;
if forinline then { discard shifted-out bits (shl never triggers overflow/range errors) }
if forinline and
(nodetype=shln) then
begin begin
{ shl/shr are unsigned operations, so cut off upper bits }
case resultdef.size of case resultdef.size of
1: 1:
lvalue:=lvalue and byte($ff); lvalue:=lvalue and byte($ff);
@ -727,7 +741,7 @@ implementation
8: 8:
lvalue:=lvalue and qword($ffffffffffffffff); lvalue:=lvalue and qword($ffffffffffffffff);
else else
internalerror(2013122301); internalerror(2019111701);
end; end;
end; end;
result:=create_simplified_ord_const(lvalue,resultdef,forinline,false); result:=create_simplified_ord_const(lvalue,resultdef,forinline,false);

View File

@ -3430,7 +3430,7 @@ unit cgx86;
list.concat(Taicpu.Op_reg(A_PUSH,S_L,NR_ECX)); list.concat(Taicpu.Op_reg(A_PUSH,S_L,NR_ECX));
list.concat(Taicpu.Op_reg(A_PUSH,S_L,NR_EBX)); list.concat(Taicpu.Op_reg(A_PUSH,S_L,NR_EBX));
list.concat(Taicpu.Op_reg(A_PUSH,S_L,NR_EAX)); list.concat(Taicpu.Op_reg(A_PUSH,S_L,NR_EAX));
inc(stackmisalignment,4*2+6*8); inc(stackmisalignment,4*2+6*4);
end; end;
{$endif i386} {$endif i386}