瀏覽代碼

+ take care of addn and subn in is_loop_invariant

git-svn-id: trunk@44251 -
florian 5 年之前
父節點
當前提交
507fc9c1ff
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      compiler/optloop.pas

+ 2 - 0
compiler/optloop.pas

@@ -275,6 +275,8 @@ unit optloop;
             end;
           typeconvn:
             result:=is_loop_invariant(loop,ttypeconvnode(expr).left);
+          addn,subn:
+            result:=is_loop_invariant(loop,taddnode(expr).left) and is_loop_invariant(loop,taddnode(expr).right);
           else
             ;
         end;