From d2aa35e9de3d8e8a88e999666714e7c3a48ecff8 Mon Sep 17 00:00:00 2001 From: florian Date: Mon, 13 Aug 2012 15:02:55 +0000 Subject: [PATCH] * throw an internal error if code generation depends on expectloc but expectloc and real loc do not match git-svn-id: trunk@22073 - --- compiler/arm/narmmat.pas | 6 +++++- compiler/avr/navrmat.pas | 4 ++++ compiler/ncgadd.pas | 6 +++++- compiler/powerpc/nppcmat.pas | 4 ++++ compiler/sparc/ncpumat.pas | 4 ++++ compiler/x86/nx86mat.pas | 4 ++++ 6 files changed, 26 insertions(+), 2 deletions(-) diff --git a/compiler/arm/narmmat.pas b/compiler/arm/narmmat.pas index c822d6c201..acc18f986a 100644 --- a/compiler/arm/narmmat.pas +++ b/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; diff --git a/compiler/avr/navrmat.pas b/compiler/avr/navrmat.pas index 6eade39697..b724b76383 100644 --- a/compiler/avr/navrmat.pas +++ b/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; diff --git a/compiler/ncgadd.pas b/compiler/ncgadd.pas index 41ba71e217..8c56f06ef0 100644 --- a/compiler/ncgadd.pas +++ b/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? } diff --git a/compiler/powerpc/nppcmat.pas b/compiler/powerpc/nppcmat.pas index faa2050082..b47d265b8b 100644 --- a/compiler/powerpc/nppcmat.pas +++ b/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; diff --git a/compiler/sparc/ncpumat.pas b/compiler/sparc/ncpumat.pas index 7f6e11bc85..d117f704f8 100644 --- a/compiler/sparc/ncpumat.pas +++ b/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; diff --git a/compiler/x86/nx86mat.pas b/compiler/x86/nx86mat.pas index 195a1ef7e1..90b133f587 100644 --- a/compiler/x86/nx86mat.pas +++ b/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;