* don't overwrite register variables when evaluating <=/>= expressions with

smallsets (left is overwritten by an "and", so it cannot be const; mantis
    #18013)

git-svn-id: trunk@16400 -
This commit is contained in:
Jonas Maebe 2010-11-22 12:58:08 +00:00
parent a1d8ad7a27
commit 44178f41b6
3 changed files with 17 additions and 1 deletions

1
.gitattributes vendored
View File

@ -10755,6 +10755,7 @@ tests/webtbs/tw1792a.pp svneol=native#text/plain
tests/webtbs/tw17945.pp svneol=native#text/pascal
tests/webtbs/tw17950.pp svneol=native#text/pascal
tests/webtbs/tw1798.pp svneol=native#text/plain
tests/webtbs/tw18013.pp svneol=native#text/plain
tests/webtbs/tw1820.pp svneol=native#text/plain
tests/webtbs/tw1825.pp svneol=native#text/plain
tests/webtbs/tw1850.pp svneol=native#text/plain

View File

@ -451,7 +451,7 @@ unit nx86add;
if (not(nf_swapped in flags) and (nodetype = lten)) or
((nf_swapped in flags) and (nodetype = gten)) then
swapleftright;
location_force_reg(current_asmdata.CurrAsmList,left.location,opsize,true);
location_force_reg(current_asmdata.CurrAsmList,left.location,opsize,false);
emit_op_right_left(A_AND,opsize);
op:=A_CMP;
{ warning: ugly hack, we need a JE so change the node to equaln }

15
tests/webtbs/tw18013.pp Normal file
View File

@ -0,0 +1,15 @@
program test;
var
wa, ws : set of 1..9;
begin
wa := [1..2];
ws := [1..3];
if (wa <= ws) and (wa <> ws) then writeln('True') else writeln('False');
if (wa <= ws) then
if (wa <> ws) then writeln('True') else writeln('False');
if (wa <= ws) then writeln('True') else writeln('False');
if (wa <> ws) then writeln('True') else writeln('False');
end.