소스 검색

* variables where the address is taken could have aliases so they aren't invariant

git-svn-id: trunk@11806 -
florian 17 년 전
부모
커밋
17d3da7266
1개의 변경된 파일4개의 추가작업 그리고 1개의 파일을 삭제
  1. 4 1
      compiler/optloop.pas

+ 4 - 1
compiler/optloop.pas

@@ -200,7 +200,10 @@ unit optloop;
               if (pi_dfaavailable in current_procinfo.flags) and
                 assigned(loop.optinfo) and
                 assigned(expr.optinfo) then
-                result:=not(DFASetIn(loop.optinfo^.defsum,expr.optinfo^.index));
+                { no aliasing? }
+                result:=not(tabstractvarsym(tloadnode(expr).symtableentry).addr_taken) and
+                { no definition in the loop? }
+                  not(DFASetIn(loop.optinfo^.defsum,expr.optinfo^.index));
             end;
         end;
       end;