Browse Source

* when getting rid of a for loop by unrolling, simplify the block afterwards,
this requires also that the constant is first passed

git-svn-id: trunk@33244 -

florian 9 years ago
parent
commit
b59219b8e0
1 changed files with 2 additions and 0 deletions
  1. 2 0
      compiler/optloop.pas

+ 2 - 0
compiler/optloop.pas

@@ -87,6 +87,7 @@ unit optloop;
               internalerror(2012090402);
               internalerror(2012090402);
             n.free;
             n.free;
             n:=cordconstnode.create(preplaceinfo(arg)^.value,preplaceinfo(arg)^.node.resultdef,false);
             n:=cordconstnode.create(preplaceinfo(arg)^.value,preplaceinfo(arg)^.node.resultdef,false);
+            do_firstpass(n);
           end;
           end;
         result:=fen_false;
         result:=fen_false;
       end;
       end;
@@ -185,6 +186,7 @@ unit optloop;
                     { create block statement }
                     { create block statement }
                     result:=internalstatements(newforstatement);
                     result:=internalstatements(newforstatement);
                     addstatement(newforstatement,unrollblock);
                     addstatement(newforstatement,unrollblock);
+                    doinlinesimplify(result);
                   end;
                   end;
               end
               end
             else
             else