Browse Source

* throw an internal error if code generation depends on expectloc but expectloc and real loc do not match

git-svn-id: trunk@22073 -
florian 13 years ago
parent
commit
d2aa35e9de

+ 5 - 1
compiler/arm/narmmat.pas

@@ -285,6 +285,10 @@ implementation
             current_procinfo.CurrTrueLabel:=current_procinfo.CurrFalseLabel;
             current_procinfo.CurrFalseLabel:=hl;
             secondpass(left);
+
+            if left.location.loc<>LOC_JUMP then
+              internalerror(2012081305);
+
             maketojumpbool(current_asmdata.CurrAsmList,left,lr_load_regvars);
             hl:=current_procinfo.CurrTrueLabel;
             current_procinfo.CurrTrueLabel:=current_procinfo.CurrFalseLabel;
@@ -307,7 +311,7 @@ implementation
                   current_asmdata.CurrAsmList.concat(taicpu.op_reg_const(A_CMP,left.location.register,0));
                   location_reset(location,LOC_FLAGS,OS_NO);
                   location.resflags:=F_EQ;
-               end;
+                end;
               else
                 internalerror(2003042401);
             end;

+ 4 - 0
compiler/avr/navrmat.pas

@@ -223,6 +223,10 @@ implementation
             current_procinfo.CurrTrueLabel:=current_procinfo.CurrFalseLabel;
             current_procinfo.CurrFalseLabel:=hl;
             secondpass(left);
+
+            if left.location.loc<>LOC_JUMP then
+              internalerror(2012081304);
+
             maketojumpbool(current_asmdata.CurrAsmList,left,lr_load_regvars);
             hl:=current_procinfo.CurrTrueLabel;
             current_procinfo.CurrTrueLabel:=current_procinfo.CurrFalseLabel;

+ 5 - 1
compiler/ncgadd.pas

@@ -114,7 +114,11 @@ interface
           begin
             current_procinfo.CurrTrueLabel:=otl;
             current_procinfo.CurrFalseLabel:=ofl;
-          end;
+          end
+        else
+          if left.location.loc=LOC_JUMP then
+            internalerror(2012081302);
+
 
 {$ifdef x86}
         { are too few registers free? }

+ 4 - 0
compiler/powerpc/nppcmat.pas

@@ -653,6 +653,10 @@ end;
                 current_procinfo.CurrTrueLabel:=current_procinfo.CurrFalseLabel;
                 current_procinfo.CurrFalseLabel:=hl;
                 secondpass(left);
+
+                if left.location.loc<>LOC_JUMP then
+                  internalerror(2012081303);
+
                 maketojumpbool(current_asmdata.CurrAsmList,left,lr_load_regvars);
                 hl:=current_procinfo.CurrTrueLabel;
                 current_procinfo.CurrTrueLabel:=current_procinfo.CurrFalseLabel;

+ 4 - 0
compiler/sparc/ncpumat.pas

@@ -293,6 +293,10 @@ implementation
             current_procinfo.CurrTrueLabel:=current_procinfo.CurrFalseLabel;
             current_procinfo.CurrFalseLabel:=hl;
             secondpass(left);
+
+            if left.location.loc<>LOC_JUMP then
+              internalerror(2012081306);
+
             maketojumpbool(current_asmdata.CurrAsmList,left,lr_load_regvars);
             hl:=current_procinfo.CurrTrueLabel;
             current_procinfo.CurrTrueLabel:=current_procinfo.CurrFalseLabel;

+ 4 - 0
compiler/x86/nx86mat.pas

@@ -229,6 +229,10 @@ interface
            current_procinfo.CurrTrueLabel:=current_procinfo.CurrFalseLabel;
            current_procinfo.CurrFalseLabel:=hl;
            secondpass(left);
+
+            if left.location.loc<>LOC_JUMP then
+              internalerror(2012081307);
+
            maketojumpbool(current_asmdata.CurrAsmList,left,lr_load_regvars);
            hl:=current_procinfo.CurrTrueLabel;
            current_procinfo.CurrTrueLabel:=current_procinfo.CurrFalseLabel;