mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-11 22:46:01 +02:00
* Fixed missing assignments with the strength reduction optimization.
This commit is contained in:
parent
bd4c206472
commit
b2165570de
@ -354,8 +354,10 @@ unit optloop;
|
|||||||
dummy : longint;
|
dummy : longint;
|
||||||
nn : tnode;
|
nn : tnode;
|
||||||
nt : tnodetype;
|
nt : tnodetype;
|
||||||
|
nflags : tnodeflags;
|
||||||
begin
|
begin
|
||||||
result:=fen_false;
|
result:=fen_false;
|
||||||
|
nflags:=n.flags;
|
||||||
case n.nodetype of
|
case n.nodetype of
|
||||||
forn:
|
forn:
|
||||||
{ inform for loop search routine, that it needs to search more deeply }
|
{ inform for loop search routine, that it needs to search more deeply }
|
||||||
@ -508,6 +510,14 @@ unit optloop;
|
|||||||
{ ... and add a temp. release node }
|
{ ... and add a temp. release node }
|
||||||
addstatement(deletecodestatements,ctempdeletenode.create(tempnode));
|
addstatement(deletecodestatements,ctempdeletenode.create(tempnode));
|
||||||
end;
|
end;
|
||||||
|
{ Copy the nf_write,nf_modify flags to the new deref node of the temp.
|
||||||
|
Othewise assignments to vector elements will be removed. }
|
||||||
|
if nflags*[nf_write,nf_modify]<>[] then
|
||||||
|
begin
|
||||||
|
if (n.nodetype<>typeconvn) or (ttypeconvnode(n).left.nodetype<>derefn) then
|
||||||
|
internalerror(2021091501);
|
||||||
|
ttypeconvnode(n).left.flags:=ttypeconvnode(n).left.flags+nflags*[nf_write,nf_modify];
|
||||||
|
end;
|
||||||
{ set types }
|
{ set types }
|
||||||
do_firstpass(n);
|
do_firstpass(n);
|
||||||
result:=fen_norecurse_false;
|
result:=fen_norecurse_false;
|
||||||
|
Loading…
Reference in New Issue
Block a user