mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-11 10:58:23 +02:00
* treat "u32bit-u32bit" as a signed value when removing automatic
64 bit upcasts, as the result can be negative when evaluated in 64 bit (reported on irc, please file bug reports) git-svn-id: trunk@27725 -
This commit is contained in:
parent
4f4e00e758
commit
e704dd8d74
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -10213,6 +10213,7 @@ tests/tbs/tb0603.pp svneol=native#text/pascal
|
||||
tests/tbs/tb0604.pp svneol=native#text/pascal
|
||||
tests/tbs/tb0605.pp svneol=native#text/pascal
|
||||
tests/tbs/tb0606.pp svneol=native#text/pascal
|
||||
tests/tbs/tb0607.pp svneol=native#text/plain
|
||||
tests/tbs/tb205.pp svneol=native#text/plain
|
||||
tests/tbs/tbs0594.pp svneol=native#text/pascal
|
||||
tests/tbs/ub0060.pp svneol=native#text/plain
|
||||
|
@ -2500,7 +2500,11 @@ implementation
|
||||
{ also done otherwise so there is no difference }
|
||||
{ in overload choosing etc between $r+ and $r-) }
|
||||
if (nf_internal in n.flags) then
|
||||
result:=true
|
||||
begin
|
||||
result:=true;
|
||||
{ the result could be negative in this case }
|
||||
gotsint:=true
|
||||
end
|
||||
else
|
||||
result:=
|
||||
docheckremove64bittypeconvs(tbinarynode(n).left) and
|
||||
|
17
tests/tbs/tb0607.pp
Normal file
17
tests/tbs/tb0607.pp
Normal file
@ -0,0 +1,17 @@
|
||||
{ %opt=-O2 }
|
||||
|
||||
var
|
||||
a,b: longword;
|
||||
i: int64;
|
||||
l1, l2: longword;
|
||||
begin
|
||||
a:=1;
|
||||
b:=123456;
|
||||
i:= (a-b) div 10;
|
||||
l1:=longword(i);
|
||||
l2:=longword((a-b) div 10);
|
||||
writeln(l1);
|
||||
writeln(l2);
|
||||
if l1<>l2 then
|
||||
halt(1);
|
||||
end.
|
Loading…
Reference in New Issue
Block a user