Преглед изворни кода

* patch by Rika: Don’t pretend optinfo^.index can be aword(−1), resolves #40405

florian пре 1 година
родитељ
комит
bcf320a76e
3 измењених фајлова са 5 додато и 7 уклоњено
  1. 1 1
      compiler/optbase.pas
  2. 0 1
      compiler/optdeadstore.pas
  3. 4 5
      compiler/optdfa.pas

+ 1 - 1
compiler/optbase.pas

@@ -35,7 +35,7 @@ unit optbase;
       PDFASet = ^TDFASet;
       PDFASet = ^TDFASet;
 
 
       toptinfo = record
       toptinfo = record
-        { index of the current node inside the dfa sets, aword(-1) if no entry }
+        { index of the current node inside the dfa sets }
         index : aword;
         index : aword;
         { dfa }
         { dfa }
         def : tdfaset;
         def : tdfaset;

+ 0 - 1
compiler/optdeadstore.pas

@@ -59,7 +59,6 @@ unit optdeadstore;
 
 
                 { we need to have dfa for the node }
                 { we need to have dfa for the node }
                 if assigned(a.left.optinfo) and
                 if assigned(a.left.optinfo) and
-                   (a.left.optinfo^.index<>aword(-1)) and
                    { node must be either a local or parameter load node }
                    { node must be either a local or parameter load node }
                    (a.left.nodetype=loadn) and
                    (a.left.nodetype=loadn) and
                    { its address cannot have escaped the current routine }
                    { its address cannot have escaped the current routine }

+ 4 - 5
compiler/optdfa.pas

@@ -188,12 +188,11 @@ unit optdfa;
           life info for the node
           life info for the node
         }
         }
         procedure updatelifeinfo(n : tnode;const l : TDFASet);
         procedure updatelifeinfo(n : tnode;const l : TDFASet);
-          var
-            b : boolean;
           begin
           begin
-            b:=DFASetNotEqual(l,n.optinfo^.life);
+            if not DFASetNotEqual(l,n.optinfo^.life) then
+              exit;
 {$ifdef DEBUG_DFA}
 {$ifdef DEBUG_DFA}
-            if not(changed) and b then
+            if not(changed) then
               begin
               begin
                 writeln('Another DFA pass caused by: ',nodetype2str[n.nodetype],'(',n.fileinfo.line,',',n.fileinfo.column,')');
                 writeln('Another DFA pass caused by: ',nodetype2str[n.nodetype],'(',n.fileinfo.line,',',n.fileinfo.column,')');
                 write('  Life info set was:     ');PrintDFASet(Output,n.optinfo^.life);writeln;
                 write('  Life info set was:     ');PrintDFASet(Output,n.optinfo^.life);writeln;
@@ -201,7 +200,7 @@ unit optdfa;
               end;
               end;
 {$endif DEBUG_DFA}
 {$endif DEBUG_DFA}
 
 
-            changed:=changed or b;
+            changed:=true;
             n.optinfo^.life:=l;
             n.optinfo^.life:=l;
           end;
           end;