From b63bc6be13cb5897c58ed33d684fe22a2fab284e Mon Sep 17 00:00:00 2001 From: pierre Date: Thu, 5 Jul 2012 21:04:03 +0000 Subject: [PATCH] MIPS: use OC_EQ instead of OC_NE for new_exception to avoid branch out of range error git-svn-id: trunk@21791 - --- compiler/ncgutil.pas | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/compiler/ncgutil.pas b/compiler/ncgutil.pas index 7f30449866..0d85a6d91c 100644 --- a/compiler/ncgutil.pas +++ b/compiler/ncgutil.pas @@ -413,6 +413,9 @@ implementation procedure new_exception(list:TAsmList;const t:texceptiontemps;exceptlabel:tasmlabel); var paraloc1,paraloc2,paraloc3 : tcgpara; +{$ifdef MIPS} + sbl : tasmlabel; +{$endif MIPS} begin paraloc1.init; paraloc2.init; @@ -440,7 +443,14 @@ implementation cg.alloccpuregisters(list,R_INTREGISTER,[RS_FUNCTION_RESULT_REG]); cg.g_exception_reason_save(list, t.reasonbuf); - cg.a_cmp_const_reg_label(list,OS_S32,OC_NE,0,cg.makeregsize(list,NR_FUNCTION_RESULT_REG,OS_S32),exceptlabel); +{$ifdef MIPS} + current_asmdata.getjumplabel(sbl); + cg.a_cmp_const_reg_label(list,OS_S32,OC_EQ,0,cg.makeregsize(list,NR_FUNCTION_RESULT_REG,OS_S32),sbl); + cg.a_jmp_always(list,exceptlabel); + cg.a_label(list,sbl); +{$else not MIPS} + cg.a_cmp_const_reg_label(list,OS_S32,OC_NE,0,cg.makeregsize(list,NR_FUNCTION_RESULT_REG,OS_S32),exceptlabel); +{$endif not MIPS} cg.dealloccpuregisters(list,R_INTREGISTER,[RS_FUNCTION_RESULT_REG]); paraloc1.done; paraloc2.done;