From abe3002b5badb867b33dfe4457e92535b089a954 Mon Sep 17 00:00:00 2001
From: Yuriy Sydorov <jura@cp-lab.com>
Date: Wed, 15 Sep 2021 00:31:10 +0300
Subject: [PATCH] * Fixed lack of the calculation code for the strength
 reduction optimization.

---
 compiler/optloop.pas | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/compiler/optloop.pas b/compiler/optloop.pas
index 8f25dfc38b..e3791dc90f 100644
--- a/compiler/optloop.pas
+++ b/compiler/optloop.pas
@@ -512,9 +512,9 @@ unit optloop;
 
             loopcode:=internalstatements(loopcodestatements);
             addstatement(loopcodestatements,tfornode(node).t2);
+            addstatement(loopcodestatements,calccode);
             tfornode(node).t2:=loopcode;
             do_firstpass(node);
-            addstatement(loopcodestatements,calccode);
 
             result:=internalstatements(newcodestatements);
             addstatement(newcodestatements,initcode);