浏览代码

* don't apply cse on static variables being regable

git-svn-id: trunk@23785 -
florian 12 年之前
父节点
当前提交
2c7b34cda1
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      compiler/optcse.pas

+ 3 - 1
compiler/optcse.pas

@@ -179,7 +179,9 @@ unit optcse;
               current stack frame, those are in registers anyways if possible
             }
             (not(n.nodetype=loadn) or
-             not(tloadnode(n).symtableentry.typ in [paravarsym,localvarsym]) or
+             not(tloadnode(n).symtableentry.typ in [paravarsym,localvarsym,staticvarsym]) or
+             { apply cse on non-regable static variables }
+             ((tloadnode(n).symtableentry.typ=staticvarsym) and (tstaticvarsym(tloadnode(n).symtableentry).varregable=vr_none)) or
              (node_complexity(n)>1)
             ) and