mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-12 14:09:17 +02:00
* replace is_written by using actualtargetnode
git-svn-id: trunk@22022 -
This commit is contained in:
parent
aad3ce960a
commit
b20c4cfe87
@ -109,14 +109,6 @@ unit optcse;
|
|||||||
function collectnodes(var n:tnode; arg: pointer) : foreachnoderesult;
|
function collectnodes(var n:tnode; arg: pointer) : foreachnoderesult;
|
||||||
var
|
var
|
||||||
i,j : longint;
|
i,j : longint;
|
||||||
|
|
||||||
function is_written(node : tnode) : boolean;
|
|
||||||
begin
|
|
||||||
while node.nodetype in [typeconvn] do
|
|
||||||
node:=ttypeconvnode(node).left;
|
|
||||||
result:=(node.flags*[nf_write,nf_modify]<>[])
|
|
||||||
end;
|
|
||||||
|
|
||||||
begin
|
begin
|
||||||
result:=fen_false;
|
result:=fen_false;
|
||||||
{ don't add the tree below an untyped const parameter: there is
|
{ don't add the tree below an untyped const parameter: there is
|
||||||
@ -135,7 +127,7 @@ unit optcse;
|
|||||||
assigned(n.resultdef) and
|
assigned(n.resultdef) and
|
||||||
(
|
(
|
||||||
{ regable expressions }
|
{ regable expressions }
|
||||||
not(is_written(n)) and
|
(n.actualtargetnode.flags*[nf_write,nf_modify]=[]) and
|
||||||
((tstoreddef(n.resultdef).is_intregable or tstoreddef(n.resultdef).is_fpuregable) and
|
((tstoreddef(n.resultdef).is_intregable or tstoreddef(n.resultdef).is_fpuregable) and
|
||||||
{ is_int/fpuregable allows arrays and records to be in registers, cse cannot handle this }
|
{ is_int/fpuregable allows arrays and records to be in registers, cse cannot handle this }
|
||||||
(not(n.resultdef.typ in [arraydef,recorddef])) and
|
(not(n.resultdef.typ in [arraydef,recorddef])) and
|
||||||
|
Loading…
Reference in New Issue
Block a user