diff --git a/.gitattributes b/.gitattributes index 6810773e21..f63f8942b1 100644 --- a/.gitattributes +++ b/.gitattributes @@ -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 diff --git a/compiler/optcse.pas b/compiler/optcse.pas index ef65859fe6..db8f805b8e 100644 --- a/compiler/optcse.pas +++ b/compiler/optcse.pas @@ -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? diff --git a/tests/webtbs/tw23342.pp b/tests/webtbs/tw23342.pp new file mode 100644 index 0000000000..e76caea681 --- /dev/null +++ b/tests/webtbs/tw23342.pp @@ -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. +