mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-07 05:08:06 +02:00
* don't perform "(x=y) or (z=u)" -> "(x xor y) or (z xor u)" optimization
if z or u may raise exceptions (mantis #37780) git-svn-id: trunk@46905 -
This commit is contained in:
parent
9f42931eeb
commit
aa75d39ab5
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -18471,6 +18471,7 @@ tests/webtbs/tw3768.pp svneol=native#text/plain
|
||||
tests/webtbs/tw3774.pp svneol=native#text/plain
|
||||
tests/webtbs/tw3777.pp svneol=native#text/plain
|
||||
tests/webtbs/tw3778.pp svneol=native#text/plain
|
||||
tests/webtbs/tw37780.pp svneol=native#text/plain
|
||||
tests/webtbs/tw3780.pp svneol=native#text/plain
|
||||
tests/webtbs/tw3782.pp svneol=native#text/plain
|
||||
tests/webtbs/tw3796.pp svneol=native#text/plain
|
||||
|
@ -1348,7 +1348,7 @@ implementation
|
||||
(left.nodetype=equaln) and
|
||||
(right.nodetype=equaln) and
|
||||
(not might_have_sideeffects(left)) and
|
||||
(not might_have_sideeffects(right)) and
|
||||
(not might_have_sideeffects(right,[mhs_exceptions])) and
|
||||
(is_constintnode(taddnode(left).left) or is_constintnode(taddnode(left).right) or
|
||||
is_constpointernode(taddnode(left).left) or is_constpointernode(taddnode(left).right) or
|
||||
is_constcharnode(taddnode(left).left) or is_constcharnode(taddnode(left).right)) and
|
||||
|
18
tests/webtbs/tw37780.pp
Normal file
18
tests/webtbs/tw37780.pp
Normal file
@ -0,0 +1,18 @@
|
||||
program testbug;
|
||||
|
||||
type
|
||||
PTestRec = ^TTestRec;
|
||||
TTestRec = record
|
||||
Val: Integer;
|
||||
Next: PTestRec;
|
||||
end;
|
||||
|
||||
var
|
||||
TR: TTestRec;
|
||||
|
||||
begin
|
||||
TR.Val := 6;
|
||||
TR.Next := nil;
|
||||
if (TR.Val = 10) or ((TR.Val = 5) and (TR.Next^.Val = 5)) then
|
||||
Writeln('OK');
|
||||
end.
|
Loading…
Reference in New Issue
Block a user