Browse Source

n68kmat.pas, tm68knotnode.pass_generate_code:
fix the double running of second_pass in the way it was intended to work: check for left.expectloc instead of left.location.loc

git-svn-id: trunk@22788 -

svenbarth 12 years ago
parent
commit
b6eac7a31b
1 changed files with 3 additions and 10 deletions
  1. 3 10
      compiler/m68k/n68kmat.pas

+ 3 - 10
compiler/m68k/n68kmat.pas

@@ -69,7 +69,6 @@ implementation
       var
       var
          hl : tasmlabel;
          hl : tasmlabel;
          opsize : tcgsize;
          opsize : tcgsize;
-         seconddone : boolean;
       begin
       begin
          opsize:=def_cgsize(resultdef);
          opsize:=def_cgsize(resultdef);
          if is_boolean(resultdef) then
          if is_boolean(resultdef) then
@@ -77,13 +76,8 @@ implementation
             { the second pass could change the location of left }
             { the second pass could change the location of left }
             { if it is a register variable, so we've to do      }
             { if it is a register variable, so we've to do      }
             { this before the case statement                    }
             { this before the case statement                    }
-            if left.location.loc<>LOC_JUMP then
-              begin
-                secondpass(left);
-                seconddone:=true;
-              end
-            else
-              seconddone:=false;
+            if left.expectloc<>LOC_JUMP then
+              secondpass(left);
 
 
             case left.location.loc of
             case left.location.loc of
               LOC_JUMP :
               LOC_JUMP :
@@ -92,8 +86,7 @@ implementation
                   hl:=current_procinfo.CurrTrueLabel;
                   hl:=current_procinfo.CurrTrueLabel;
                   current_procinfo.CurrTrueLabel:=current_procinfo.CurrFalseLabel;
                   current_procinfo.CurrTrueLabel:=current_procinfo.CurrFalseLabel;
                   current_procinfo.CurrFalseLabel:=hl;
                   current_procinfo.CurrFalseLabel:=hl;
-                  if not seconddone then
-                    secondpass(left);
+                  secondpass(left);
                   maketojumpbool(current_asmdata.CurrAsmList,left,lr_load_regvars);
                   maketojumpbool(current_asmdata.CurrAsmList,left,lr_load_regvars);
                   hl:=current_procinfo.CurrTrueLabel;
                   hl:=current_procinfo.CurrTrueLabel;
                   current_procinfo.CurrTrueLabel:=current_procinfo.CurrFalseLabel;
                   current_procinfo.CurrTrueLabel:=current_procinfo.CurrFalseLabel;