mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-13 12:49:20 +02:00
* don't do mul->shl optimizations when compiling with overflow checking
* keep operand size sign information in shl/shr git-svn-id: trunk@3566 -
This commit is contained in:
parent
14965179c4
commit
55962cef95
@ -165,13 +165,20 @@ implementation
|
|||||||
op:=A_SHR;
|
op:=A_SHR;
|
||||||
|
|
||||||
{ special treatment of 32bit values for backwards compatibility }
|
{ special treatment of 32bit values for backwards compatibility }
|
||||||
|
{ mul optimizations require to keep the sign (FK) }
|
||||||
if left.resulttype.def.size<=4 then
|
if left.resulttype.def.size<=4 then
|
||||||
begin
|
begin
|
||||||
|
if is_signed(left.resulttype.def) then
|
||||||
|
opsize:=OS_S32
|
||||||
|
else
|
||||||
opsize:=OS_32;
|
opsize:=OS_32;
|
||||||
mask:=31;
|
mask:=31;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
|
if is_signed(left.resulttype.def) then
|
||||||
|
opsize:=OS_S64
|
||||||
|
else
|
||||||
opsize:=OS_64;
|
opsize:=OS_64;
|
||||||
mask:=63;
|
mask:=63;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user