mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-17 08:39:33 +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;
|
||||
nn : tnode;
|
||||
nt : tnodetype;
|
||||
nflags : tnodeflags;
|
||||
begin
|
||||
result:=fen_false;
|
||||
nflags:=n.flags;
|
||||
case n.nodetype of
|
||||
forn:
|
||||
{ inform for loop search routine, that it needs to search more deeply }
|
||||
@ -508,6 +510,14 @@ unit optloop;
|
||||
{ ... and add a temp. release node }
|
||||
addstatement(deletecodestatements,ctempdeletenode.create(tempnode));
|
||||
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 }
|
||||
do_firstpass(n);
|
||||
result:=fen_norecurse_false;
|
||||
|
Loading…
Reference in New Issue
Block a user