mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-13 12:29:14 +02:00
* fix try_make_mul32to64() if it's called with a constant node on the
left (mantis #37878) o can happen if use_generic_mul32to64 returns false git-svn-id: trunk@47142 -
This commit is contained in:
parent
0e474f4748
commit
099134b545
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -18493,6 +18493,7 @@ tests/webtbs/tw37806.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw3782.pp svneol=native#text/plain
|
||||
tests/webtbs/tw37823.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw37844.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw37878.pp svneol=native#text/plain
|
||||
tests/webtbs/tw37926.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw3796.pp svneol=native#text/plain
|
||||
tests/webtbs/tw3805.pp svneol=native#text/plain
|
||||
|
@ -3572,6 +3572,9 @@ implementation
|
||||
canbesignedconst, canbeunsignedconst: boolean;
|
||||
begin
|
||||
result := false;
|
||||
{ make sure that if there is a constant, that it's on the right }
|
||||
if left.nodetype = ordconstn then
|
||||
swapleftright;
|
||||
if is_32to64typeconv(left) then
|
||||
begin
|
||||
leftoriginallysigned:=is_signed(ttypeconvnode(left).left.resultdef);
|
||||
@ -3747,11 +3750,7 @@ implementation
|
||||
|
||||
{ make sure that if there is a constant, that it's on the right }
|
||||
if left.nodetype = ordconstn then
|
||||
begin
|
||||
temp := right;
|
||||
right := left;
|
||||
left := temp;
|
||||
end;
|
||||
swapleftright;
|
||||
|
||||
{ can we use a shift instead of a mul? }
|
||||
if not (cs_check_overflow in current_settings.localswitches) and
|
||||
|
8
tests/webtbs/tw37878.pp
Normal file
8
tests/webtbs/tw37878.pp
Normal file
@ -0,0 +1,8 @@
|
||||
{$mode objfpc}
|
||||
var i64: int64; w: word;
|
||||
begin
|
||||
{$Q+}
|
||||
w := 4096;
|
||||
i64 := 8191;
|
||||
i64 := i64 - 2*int64(w);
|
||||
end.
|
Loading…
Reference in New Issue
Block a user