* setelement nodes itself should not be considered, since setelement

nodes generate no code except loading data into registers, this does
  not hurt, resolves #23342

git-svn-id: trunk@23039 -
This commit is contained in:
florian 2012-11-20 21:15:38 +00:00
parent fcc6d3dcd9
commit 4aca018f62
3 changed files with 24 additions and 2 deletions

1
.gitattributes vendored
View File

@ -13004,6 +13004,7 @@ tests/webtbs/tw2323.pp svneol=native#text/plain
tests/webtbs/tw23270.pp svneol=native#text/pascal
tests/webtbs/tw2328.pp svneol=native#text/plain
tests/webtbs/tw2332.pp svneol=native#text/plain
tests/webtbs/tw23342.pp svneol=native#text/pascal
tests/webtbs/tw2351.pp svneol=native#text/plain
tests/webtbs/tw2363.pp svneol=native#text/plain
tests/webtbs/tw2377.pp svneol=native#text/plain

View File

@ -158,8 +158,12 @@ unit optcse;
{ same for voiddef }
not(is_void(n.resultdef)) and
{ adding tempref and callpara nodes itself is worthless but
their complexity is probably <= 1 anyways }
not(n.nodetype in [temprefn,callparan]) and
their complexity is probably <= 1 anyways
neither add setelementn nodes because the compiler sometimes depends on the fact
that a certain node stays a setelementn, this does not hurt either because
setelementn nodes itself generate no real code (except moving data into register) }
not(n.nodetype in [temprefn,callparan,setelementn]) and
{ node worth to add?

17
tests/webtbs/tw23342.pp Normal file
View File

@ -0,0 +1,17 @@
uses
classes;
procedure foo(Shift: TShiftState);
var
ssMultiSelect: TShiftStateEnum;
ATest: Boolean;
begin
ssMultiSelect := ssCtrl;
// ATest := (Shift = [ssLeft, ssMultiSelect]); // compiles
// ATest := ATest or (Shift = [ssMultiSelect]); // compiles
ATest := (Shift = [ssLeft, ssMultiSelect]) or (Shift = [ssMultiSelect]); // fatal internal error 200203302 with -O2 or -O3
end;
begin
end.