diff --git a/compiler/aarch64/ncpuset.pas b/compiler/aarch64/ncpuset.pas index abd7ac4b65..05a3b6b657 100644 --- a/compiler/aarch64/ncpuset.pas +++ b/compiler/aarch64/ncpuset.pas @@ -177,7 +177,9 @@ implementation last:=0; lastrange:=false; first:=true; + cg.a_reg_alloc(current_asmdata.CurrAsmList, NR_DEFAULTFLAGS); genitem(hp); + cg.a_reg_dealloc(current_asmdata.CurrAsmList, NR_DEFAULTFLAGS); cg.a_jmp_always(current_asmdata.CurrAsmList,elselabel); end; end; diff --git a/compiler/arm/narmset.pas b/compiler/arm/narmset.pas index 9c0d668134..71339f022c 100644 --- a/compiler/arm/narmset.pas +++ b/compiler/arm/narmset.pas @@ -406,7 +406,9 @@ implementation last:=0; lastrange:=false; first:=true; + cg.a_reg_alloc(current_asmdata.CurrAsmList, NR_DEFAULTFLAGS); genitem(hp); + cg.a_reg_dealloc(current_asmdata.CurrAsmList, NR_DEFAULTFLAGS); cg.a_jmp_always(current_asmdata.CurrAsmList,elselabel); end; end; diff --git a/compiler/ncgset.pas b/compiler/ncgset.pas index e92d05c0cc..dc619a7cbf 100644 --- a/compiler/ncgset.pas +++ b/compiler/ncgset.pas @@ -769,11 +769,13 @@ implementation last:=0; first:=true; scratch_reg:=hlcg.getintregister(current_asmdata.CurrAsmList,opsize); + cg.a_reg_alloc(current_asmdata.CurrAsmList,NR_DEFAULTFLAGS); genitem(hp); end else begin { If only one label exists, we can greatly simplify the checks to a simple comparison } + cg.a_reg_alloc(current_asmdata.CurrAsmList,NR_DEFAULTFLAGS); if hp^._low=hp^._high then hlcg.a_cmp_const_reg_label(current_asmdata.CurrAsmList, opsize, OC_EQ, tcgint(hp^._low.svalue), hregister, blocklabel(hp^.blockid)) else @@ -783,6 +785,7 @@ implementation hlcg.a_cmp_const_reg_label(current_asmdata.CurrAsmList, opsize, OC_BE, tcgint(hp^._high.svalue-hp^._low.svalue), hregister, blocklabel(hp^.blockid)) end; end; + cg.a_reg_dealloc(current_asmdata.CurrAsmList,NR_DEFAULTFLAGS); hlcg.a_jmp_always(current_asmdata.CurrAsmList,elselabel); end; end; @@ -1080,7 +1083,9 @@ implementation begin last:=0; lastwasrange:=false; + cg.a_reg_alloc(current_asmdata.CurrAsmList,NR_DEFAULTFLAGS); genitem(hp); + cg.a_reg_dealloc(current_asmdata.CurrAsmList,NR_DEFAULTFLAGS); hlcg.a_jmp_always(current_asmdata.CurrAsmList,elselabel); end; diff --git a/compiler/x86/nx86set.pas b/compiler/x86/nx86set.pas index 6c37eb4891..bac0b91cfe 100644 --- a/compiler/x86/nx86set.pas +++ b/compiler/x86/nx86set.pas @@ -240,8 +240,10 @@ implementation cg.a_cmp_const_reg_label(current_asmdata.CurrAsmList, opcgsize, OC_EQ,0,hregister,blocklabel(t^.blockid)) else begin + cg.a_reg_alloc(current_asmdata.CurrAsmList, NR_DEFAULTFLAGS); cg.a_op_const_reg(current_asmdata.CurrAsmList, OP_SUB, opcgsize, aint(t^._low.svalue-last.svalue), hregister); cg.a_jmp_flags(current_asmdata.CurrAsmList,F_E,blocklabel(t^.blockid)); + cg.a_reg_dealloc(current_asmdata.CurrAsmList, NR_DEFAULTFLAGS); end; last:=t^._low; lastrange:=false; @@ -252,6 +254,7 @@ implementation { it begins with the smallest label, if the value } { is even smaller then jump immediately to the } { ELSE-label } + cg.a_reg_alloc(current_asmdata.CurrAsmList, NR_DEFAULTFLAGS); if first then begin { have we to ajust the first value ? } @@ -287,6 +290,7 @@ implementation cg.a_op_const_reg(current_asmdata.CurrAsmList, OP_SUB, opcgsize, range, hregister); cg.a_jmp_flags(current_asmdata.CurrAsmList,cond_le,blocklabel(t^.blockid)); + cg.a_reg_dealloc(current_asmdata.CurrAsmList, NR_DEFAULTFLAGS); last:=t^._high; lastrange:=true; end;