* make integer division instruction (div/idiv) on x86 dependent on the

resulttype of the div node set by the type checking pass, this is 
  also how the generic code generator handles it, resolves #27173

git-svn-id: trunk@29382 -
This commit is contained in:
florian 2015-01-04 13:08:57 +00:00
parent 3cdf2d0e53
commit 29d4037a9c
3 changed files with 19 additions and 2 deletions

1
.gitattributes vendored
View File

@ -14173,6 +14173,7 @@ tests/webtbs/tw2710.pp svneol=native#text/plain
tests/webtbs/tw27120.pp svneol=native#text/pascal
tests/webtbs/tw2713.pp svneol=native#text/plain
tests/webtbs/tw27153.pp svneol=native#text/pascal
tests/webtbs/tw27173.pp svneol=native#text/pascal
tests/webtbs/tw27185.pp svneol=native#text/pascal
tests/webtbs/tw2721.pp svneol=native#text/plain
tests/webtbs/tw2723.pp svneol=native#text/plain

View File

@ -527,8 +527,8 @@ interface
else
emit_reg_reg(A_XOR,opsize,regd,regd);
{Division depends on the right type.}
if is_signed(right.resultdef) then
{ Division depends on the result type }
if is_signed(resultdef) then
op:=A_IDIV
else
op:=A_DIV;

16
tests/webtbs/tw27173.pp Normal file
View File

@ -0,0 +1,16 @@
program error;
{$mode Delphi}
uses sysutils;
type a = 1..MaxInt;
var b: a;
c: integer;
begin
b := 3;
c := -5 div b;
writeln(c);
end.