* 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:
Jonas Maebe 2014-05-03 15:06:16 +00:00
parent 4f4e00e758
commit e704dd8d74
3 changed files with 23 additions and 1 deletions

1
.gitattributes vendored
View File

@ -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

View File

@ -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
View 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.